In May 1689 Somers was made solicitor-general. He now became William IIIís most confidential adviser. In the controversy which arose between the Houses on the question of the legality of the decision. of the court of Kingís Bench regarding Titus Oates, and of the action of the Lords in sustaining this decision, Somers was again the leading manager for the Commons, and has left a clear and interesting account of the debates. He was next employed in January 1690 as chairman of the select committee of the House of Commons on the Corporation Bill, by which those corporations which had surrendered their charters to the Crown during the last two reigns were restored to their rights; but he refused to associate himself with the violent measures of retaliation which the Whigs on that occasion endeavoured to include in the bill. In April a speech by him carried through the lower house, without opposition, the bill which declared all the laws passed by the Convention Parliament to be valid. As solicitor-general he had to conduct the prosecution of Preston and Asbton in 1691, and did so with a moderation and humanity which were in marked contrast to the customs of the former reigns. He was soon after appointed attorney-general, and in that capacity strongly opposed the bill for the regulation of trials in cases of high treason. On 23 March 1693, the great seal having meanwhile been in commission, Somers was appointed Lord-Keeper, with a pension of £2000 a year from the day on which he should quit his office, and at the same time was made a privy councillor. He had previously been knighted. Somers now became the most prominent member of the Junto, the small council which comprised the chief members of the Whig party. When William left in May 1695 to take command of the army in the Netherlands, Somers was made one of the seven lords-justices to whom the administration of the kingdom during his absence was entrusted; and he was instrumental in bringing about a reconciliation between William and the Princess Anne.
In April 1697 Somers was made Lord Chancellor, and was created a peer by the title of Baron Somers of Evesham. When the discussion arose on the question of disbanding the army, he summed up the case against disbanding, in answer to Trenchard in a remarkable pamphlet called The Balancing Letter. In August 1698. he went to Tunbridge Wells for his health. While there he received the kingís letter announcing the first Partition Treaty, and at once replied with a memorandum representing the necessity in the state of feeling in England of avoiding further war. When the king, on the occasion of the Disbanding Bill, expressed his determination to leave the country, Somer boldly remonstrated, while he dearly expressed in a speech in thr Lords the danger of the course that was being taken. Hitherto Somersís character had kept him free from attack at the hands of political opponents; but his connexion in 1699 with the notorious Captain William Kidd, to the cost of whose expedition Somers had given £1 000, afforded an opportunity; the vote of censure, however, proposed upon him in the House of Commons for giving Kidd a commission under the great seal was rejected by 199 to 131. The attack was renewed shortly on the ground of his having accepted grants of Crown property to the amount of £1600 a year, but was again defeated. On the subject of the Irish forfeitures a third attack was made in 1700, a motion being brought forward to request the king to remove Somers from his counsels and presence for ever; but this again was rejected by a large majority. In consequence, however, of the incessant agitation William now requested Somers to resign; this he refused to do, but gave up the seals to Williamís messenger. In 1701 he was impeached by the Commons on account of the part he had taken in the negotiations relating to the Partition Treaty in 1698, and defended himself most ably before the house, answering the charges seriatim. The impeachment was voted and sent up to the Lords, but was there dismissed. On the death of the king Somers retired almost entirely into private life. He was president of the Royal Society from 1699 to 1704. He was, however, active in 1702 in opposing the Occasional Conformity Bill, and in 1706 was one of the managers of the union with Scotland. In the same year he carried a bill regulating and improving the proceedings of the law courts. He was made Lord President of the Council in 1708 upon the return of the Whigs to power, and retained the office until their downfall in 1710. He died on 26 April 1716. Somers was never married, but left two sisters, of whom the eldest, Mary, married Charles Cocks, whose grandson, Sir Charles Cocks, bart., became the second Lord Somers in 1784, the title subsequently descending in this line.