In 1679, dissidents murdered Archbishop Sharp and Moray helped put down a short-lived rebellion. This resulted in his appointment on 17 July 1680 as an Extraordinary Lord of Session; when Lauderdale was dismissed soon after, he nominated Moray as Secretary of State in his place. James approved this, but insisted Moray share the position, first with Middleton, then Melfort.