McGuiness was one of Sinn Fein's top debaters at the Good Friday Agreement of 1998 and was elected as a Member of the Northern Ireland Assembly in 1998 for the constituency of Mid Ulster. He was the Minister of Education in the Northern Ireland executive from 1999 to 2002. On 8 May 2007, following the St. Andrew's Agreement Martin McGuiness was made the Deputy First Minister of Northern Ireland. Ian Paisley of the Democratic Unionist Party was the First Minister until June 5, 2008 when he was replaced by Peter Robinson.