The trial was extremely unpopular with much of the country, causing the Sacheverell riots, and was followed by the downfall of the Duke of Marlborough and the Whig Party in the general election of 1710. The new ministry, under the leadership of the Tory Robert Harley, removed Walpole from his office of Secretary at War but he remained Treasurer of the Navy until 2 January 1711. Harley had first attempted to entice him and then threatened him to join the Tories, but Walpole rejected the offers, instead becoming one of the most outspoken members of the Whig Opposition. He effectively defended Lord Godolphin against Tory attacks in parliamentary debate, as well as in the press. In 1712, Walpole was accused of venality and corruption in the matter of two forage contracts for Scotland. Although it was proven that he had retained none of the money, Walpole was pronounced "guilty of a high breach of trust and notorious corruption". He was impeached by the House of Commons and found guilty by the House of Lords; he was then imprisoned in the Tower of London for six months and expelled from Parliament. While in the Tower he was regarded as a political martyr, and visited by all the Whig leaders. After he was released, Walpole wrote and published anonymous pamphlets attacking the Harley ministry and assisted Sir Richard Steele in crafting political pamphlets. Walpole was re-elected for King's Lynn in 1713. Queen Anne died in 1714. Under the Act of Settlement 1701, which excluded Roman Catholics from the line of succession, Anne was succeeded by her second cousin, the Elector of Hanover, George I. George I distrusted the Tories, who he believed opposed his right to succeed to the Throne. The year of George's accession, 1714, marked the ascendancy of the Whigs who would remain in power for the next fifty years. Robert Walpole became a Privy Councillor and rose to the position of Paymaster of the Forces in a Cabinet nominally led by Lord Halifax, but actually dominated by Lord Townshend (Walpole's brother-in-law) and James Stanhope. Walpole was also appointed chairman of a secret committee formed to investigate the actions of the previous Tory ministry in 1715. Lord Oxford was impeached, and Lord Bolingbroke suffered from an act of attainder. Lord Halifax, the titular head of the administration, died in 1715 and by 1716 Walpole was appointed to the posts of First Commissioner (Lord) of the Treasury and Chancellor of the Exchequer.