Maskey stood unsuccessfully in West Belfast in the 1982 Assembly Election. In June 1983, Maskey won a by-election and became the first member of Sinn Féin to be elected to Belfast City Council. He was greeted with boos and jeers when he entered the chamber for his first council meeting, and unionist councillors started stamping their feet and screaming when he attempted to deliver his maiden speech in Irish. Maskey emerged as a key ally of Sinn Féin President Gerry Adams' approach to the strategy. In 1987 he survived being shot at close range by loyalist paramilitaries. He was targeted again by loyalists in 1988, and also a gun attack at his home in 1993 when one his friends was killed. In 1996 Maskey was elected to the Northern Ireland Peace Forum for the Belfast West constituency but did not attend the Forum in accordance with Sinn Féin's policy of abstentionism. Two years later he was elected to the Northern Ireland Assembly, which on this occasion Sinn Féin did not boycott. Maskey's growing political profile led him to contest the Belfast South constituency in the 2001 general election as part of Sinn Féin's strategy of building up their vote in one of their weaker constituencies. In the local elections held on the same day he switched to the Laganbank area of South Belfast and won a seat there. In 2002 Maskey became the first ever republican to serve as Lord Mayor of Belfast. His first duty in office was to open the annual Presbyterian General Assembly despite being a non-Presbyterian. Maskey garnered general praise when as part of his duties as Lord Mayor in July 2002 he laid a wreath in memorial of British soldiers who died in the First World War. However he declined to attend the main memorial ceremony, stating that it was "the military commemoration of the Battle of the Somme". In his office he flew the British Union Jack and the Irish tricolourside by side. In the 2003 Assembly election Maskey stood in South Belfast again and won Sinn Féin's first seat there with a boost in the vote share. He contested the seat in the 2005 general election with the vote share down on the Assembly elections, losing to the Social Democratic and Labour Party candidate, Alasdair McDonnell.
Health
On 25 December 2005, Maskey suffered a heart attack while with his family. Several weeks later he appeared on BBC Radio Ulster to talk about his health.
Later years
In 2006 he participated in the negotiations resulting in the Basque nationalist organisation ETA truce announced on 22 March. On 23 April 2007 he was announced as one of three Sinn Féin members who would sit on the re-vamped Northern Ireland Policing Board. Maskey resigned from Belfast City Council in October 2010, as part of Sinn Féin's policy of abolishing double jobbing. With the restoration of the Northern Ireland Assembly at Stormont, Maskey was elected Speaker on 11 January 2020.