Serendipitously, he became known personally to the governor-general, which resulted in his appointment as political agent in Ottoman Arabia. Thus he settled in Baghdad, where he devoted himself to cuneiform studies. He was now able, with considerable difficulty and at no small personal risk, to make a complete transcript of the Behistun inscription, which he was also successful in deciphering and interpreting. Having collected a large amount of invaluable information on this and kindred topics, in addition to much geographical knowledge gained in the prosecution of various explorations (including visits with Sir Austen Henry Layard to the ruins of Nineveh), he returned to England on leave of absence in 1849.