Following the accession of James II, Danby was discharged from his bail by the Lords on 19 May 1685, and the order declaring dissolution of Parliament not to be abatement of impeachment was reversed. He took his seat in the Lords as a leader of the moderate Tory party. Though a supporter of the hereditary principle, he soon found himself more and more opposed to James, and in particular to James's attacks on Anglicanism. He was visited by Dykvelt, William of Orange's agent; and in June 1687 he wrote to William assuring him of his support. On 30 June 1688, he was one of the seven politicians in the Revolution who signed the "Invitation to William". In November, he occupied York for William, returning to London to meet William on 26 December. He appears to have thought that William would not claim the crown, and at first supported the theory that as the throne had been vacated by James's flight, the succession fell to Mary. This met with little support and was rejected both by William and by Mary herself, so he voted against the regency and joined with Halifax and the Commons in declaring the prince and princess joint sovereigns.