Murray was initially a supporter of the robust policies of Lord Lauderdale, taking part in a 1678 raid against the Covenanters, but he then temporarily lost royal favour by counselling moderation concerning the measures taken against them. In 1679, however, he was present at the Battle of Bothwell Bridge; in July 1680 he was made vice-admiral of Scotland, and in 1681 president of parliament.