Accord marks rare instance of co-operation and pragmatism between two foes that have never held diplomatic ties