Gordon visited England and Scotland in 1686. In 1687 and 1689 he took part in expeditions against the Tatars in the Crimea, being made a full general. Later in 1689 a revolution broke out in Moscow, and with the troops under his command Gordon virtually decided events in favour of Peter the Great, and against the Regent, Tsarevna Sophia Alekseyevna. Consequently, he was for the remainder of his life in high favour with the Tsar, who confided to him the command of his capital during his absence from Russia. In 1696, Gordon's design of a "moveable rampart" played a key role in helping the Russians take Azov. One of Gordon's greatest achievements was securing permission from the Tsars to establish the first Roman Catholic church and school in Muscovy, of which he remained the main benefactor, and headed the Catholic community in Russia until his death. For his services his second son James, brigadier of the Russian army, was created Count of the Holy Roman Empire in 1701. The Tsar employed him in organizing his army according to the West European system; and raised him to the rank of full general. At the end of his life the Tsar, who had visited Gordon frequently during his illness, was with him when he died, and with his own hands closed his eyes. Originally buried in the Foreign Quarter, his remains were reinterred at Azov in 1877, with an inscription in German which mistakenly gives his rank as "Oberst", Colonel. General Gordon left behind him a uniquely detailed diary of his life and times, written in English. This is preserved in manuscript in the Russian State Military Archive in Moscow. An incomplete and faulty German translation, edited by Dr Moritz Posselt ("Tagebuch des Generals Patrick Gordon") was published, the first volume at Moscow in 1849, the second at St Petersburg in 1851, and the third at St Petersburg in 1853; and "Passages from the Diary of General Patrick Gordon of Auchleuchries" (1635–1699), was printed, under the editorship of Joseph Robertson, for the Spalding Club, at Aberdeen, Scotland, 1859. A new full scholarly edition of Gordon's Diary in English was published by the Centre for Irish and Scottish Studies in Aberdeen (6 vols, 2009-2016), as well as its translation into Russian. His daughter was married firstly to the German-Russian Colonel Rudolf Strasburgh, and then from 1699 or 1700 to his kinsman in the Russian service Alexander Gordon of Auchintoul, author of "The History of Peter the Great, Emperor of Russia".