he was also governor of upnor castle from 1775 to 1778. in 1776, he bought his mother's estate of strowan from his nephew, the duke of atholl. after the outbreak of the american war of independence, he offered to raise a new highland regiment, but was refused. he joined the brigade of guards in north america in march 1777, where he was wounded during the philadelphia campaign. promoted to the rank of colonel on 16 december 1777, he was appointed the colonel of the atholl highlanders, newly raised by the duke of atholl, on 16 may 1778. he commanded them in ireland until the regiment was disbanded in 1783. in 1780, murray was appointed governor of fort william. this was the year of the gordon riots. murray denounced his kinsman lord george gordon, and, when the rioters gordon had stirred up prepared to storm the house of commons, he threatened to put a sword through gordon, who was sitting next to him, if they broke in. during his later years in parliament he supported william pitt the younger. he became a major general in 1782, and on the disbanding of the atholl highlanders, was appointed lieutenant-colonel commandant of the 78th highlanders. he was appointed their colonel when they were renumbered the 72nd in 1786, and was made a lieutenant general in 1793.