but lost the seat in the October election of the same year. After losing his seat, he again took up legal practise. Ancram re-entered Parliament at the 1979 election as the Member of Parliament for Edinburgh South, beating future Prime Minister Gordon Brown. He was a member of the House of Commons Energy Select Committee between 1979 and 1983, and Chairman of the Scottish Conservative and Unionist Party from 1980 to 1983. He was Parliamentary Under-Secretary of State at the Scottish Office with responsibility for Home Affairs, Housing, Local Government, Rating Reform and the Environment from 1983 until 1987. He lost his seat again at the 1987 general election, being one of several prominent Conservatives defeated in Scotland in that contest. After losing his seat in 1987, Ancram returned to Parliament at the 1992 general election representing Devizes. He was a member of the Public Accounts Committee and Chairman of the backbench Constitutional Affairs Committee from 1992 until May 1993, when he was appointed Parliamentary Under-Secretary of State at the Northern Ireland Office. He was promoted to Minister of State at the Northern Ireland Office in January 1994, and was sworn as a Privy Councillor in January 1996. Shadow Cabinet and failed leadership bid After the Conservatives' defeat at the 1997 election, Ancram served in the Shadow Cabinet as Shadow Constitutional Affairs Spokesperson from June 1997 to June 1998. He then served as Chairman of the Conservative Party from December 1998 to September 2001. In 2001, he ran against Iain Duncan Smith, Michael Portillo, Kenneth Clarke and David Davis in the election for the party leadership. In the first poll of Conservative MPs he and David Davis were tied for last place, leading to a re-run in which Ancram was placed bottom. He was eliminated, and Davis withdrew. Both swung their support behind Iain Duncan Smith, who went on to win, beating Clarke in the final vote of party members. Duncan Smith made Ancram Deputy Leader of the Conservative Party and Shadow Secretary of State for Foreign and Commonwealth Affairs in September 2001. He remained in this position after Michael Howard took over in 2003. In the reshuffle following the 2005 election, Ancram was moved to Shadow Secretary of State for Defence but remained deputy leader. He stood down from the Shadow Cabinet in December 2005, following the election of David Cameron as Conservative Party Leader. In January 2006 he