He was re-elected to the Parliaments of 1679 and played an active part in the attempt to pass the Exclusion Bill to bar the Duke of York from the succession and also supported the bill to give toleration to Protestant dissenters. In 1681 he was elected to the Oxford Parliament for the county of Buckinghamshire (exchanging seats with his son John Hampden). During the convening of this short parliament he again supported exclusion.[4]
In 1685, Hampden again represented the borough of Wendover but was far less active in politics as King James II, the man Hampden had tried to exclude from the succession, was now king. After the successful invasion by William of Orange, he chaired the committee of members of James II's parliament that on 27 December 1688, invited William to call a convention and to take over the government in the interim. Hampden sat in the Convention Parliament of 1689 and was a central figure in the enabling legislation to crown William and Mary. In February 1689 he became a privy councillor, and on 9 April became a commissioner of the Treasury.[4]
In 1690 he represented the county of Buckinghamshire in William and Mary's first parliament, and in the same year was made Chancellor of the Exchequer. During the next five years, when his health allowed, he was active in the government. He did not stand for re-election to William and Mary's second parliament in 1695, and died on 15 December 1695.[4]