 In July 1846 he was appointed Solicitor General for England and Wales.At the time, it was the normal practice that accepting ministerial office caused a by-election; he was re-elected on 28 July.In February 1846 he was knighted, a traditional perquisite of the office, but he resigned the position in March 1848 due to ill-health and returned to the backbenches.