Entering Parliament in 1822 as a Whig, he served as Chief Secretary for Ireland (1830–33) and subsequently as Colonial Secretary (1833–34), when he introduced the successful proposals to abolish slavery in the British empire. In the later 1830s he left the Whigs and joined Sir Robert Peel’s Conservative government of 1841, but resigned over the repeal of the Corn Laws. Together with Benjamin Disraeli he led the Conservative opposition to the succeeding Whig administration. He was Prime Minister in 1852, in 1858–59, and again from 1866 to 1868, when he carried the Reform Act of 1867 through Parliament. This act, which redistributed the parliamentary seats and more than doubled the electorate, gave the vote to many working men in the towns.