He entered Parliament as a Whig, and during the early years of Queen Anne’s reign served variously as Speaker of the House of Commons and Secretary of State. He abandoned the Whigs and used the influence of his cousin Abigail Masham, a lady-in-waiting, to undermine Marlborough’s standing with the queen. In 1710 he headed the new Tory government whose greatest achievement was the Peace of Utrecht (1713). In the subsequent power struggle among the Tories just before Anne’s death in 1714 he lost to Viscount Bolingbroke, and the Whig administration of George I imprisoned him and began impeachment proceedings against him. He was released two years later, but took no further part in public affairs.