Lord Robert Cecil was first elected to the House of Commons in 1854 and served as Secretary of State for India in Lord Derby's Conservative government 1866–1867. In 1874, under Disraeli, Salisbury returned as Secretary of State for India, and, in 1878, was appointed foreign secretary, and played a leading part in the Congress of Berlin. After Disraeli's death in 1881, Salisbury emerged as Conservative leader in the House of Lords, with Sir Stafford Northcote leading the party in the Commons. He succeeded William Ewart Gladstone as prime minister in June 1885, and held the office until January 1886. When Gladstone came out in favour of Home Rule for Ireland, Salisbury opposed him and formed an alliance with the breakaway Liberal Unionists, winning the subsequent general election. His great achievement in this term was obtaining the majority of new territory in Africa during the Scramble for Africa, avoiding a war or serious confrontation with the other powers. He remained as prime minister until Gladstone's Liberals formed a government with the support of the Irish nationalists at the 1892 general election. The Liberals, however, lost the 1895 general election, and Salisbury for the third and last time became prime minister. He led Britain to victory in a bitter, controversial war against the Boers, and led the Unionists to another electoral victory in 1900. He relinquished the premiership to his nephew Arthur Balfour in 1902 and died in 1903. He was the last prime minister to serve from the House of Lords.