In 1868, Playfair was elected Liberal Member of Parliament for the Universities of Edinburgh and St Andrews, being sworn of the Privy Council and made Postmaster General in Gladstone's government in 1873. The Liberals lost power in early 1874 but on their return to office in 1880, Playfair was appointed Chairman of Ways and Means and Deputy Speaker of the House of Commons, holding these posts until 1883, when he was created a Knight Commander of the Order of the Bath. He was subsequently President of the British Association in 1885. In February 1886 he returned to the government as Vice-President of the Committee on Education under Gladstone, a post he held until the government fell in July of the same year. He was made a member of the Council of the Duchy of Cornwall in 1889.