The British Foreign Office said it had mediated the two men 's release .