Arlene Foster, Martin McGuinness, Mike Nesbitt, Colum Eastwood and David Ford all took part in Election 2016: The Leaders' Debate.
They were questioned by a studio audience made up mostly of grassroots supporters and some undecided voters.
The debate was simulcast to UK-wide audiences on the BBC News channel.
It was hosted by Noel Thompson.
An early flashpoint in the debate came between Mike Nesbitt and Arlene Foster over who should be first minister.
"I think that Arlene has a five-word plan - do not mention Peter Robinson," said Mr Nesbitt.
"I have a one-point plan - the Ulster Unionist one-point plan is make it work. Make Stormont work."
Mrs Foster replied: "Unlike Mike Nesbitt, I remember the bad old days of pushover unionism.
"I remember what it was like in 1998 when we had a concession a day to the IRA, I remember what happened in relation to prisoners, I remember what happened to the RUC."
David Ford said that the argument over who should be first minister was about trying to frighten people.
"I think it's rather sad that this is now the third election in a row that the DUP's campaign has been based on the politics of fear.
He added: "Not looking forward to the future, not looking about growing our economy, not looking about growing a united community, not looking to meet the needs of our children to stop them emigrating.
"Instead of that we're just into who's biggest and who's not biggest."
Martin McGuinness and Colum Eastwood also clashed over who would be in government or opposition after the election.
Mr McGuinness accused the SDLP leader of not knowing "what he wants to do" over being in government, but Mr Eastwood responded that the election is "not a coronation".
"I am going into government. Colum can't say that tonight. I am going into government," said Mr McGuinness.
Mr Eastwood replied: "Not like in the south, where they've refused to go into government at every opportunity."
During the debate, the leaders also faced questions on health, the past, the economy and the make-up of the government after the election.
Following the debate, political discussion continued in The Spin Room, a programme that provided instant analysis and reaction to the leaders' debate.
The programme featured senior representatives from the Green Party, TUV and UKIP.
An invited audience of commentators, members of the public and private sector, and young people from the BBC Generation 2016 initiative also gave their views on the debate.

Clifton, 18, spent the 2016-17 season on loan with Grantham Town in the Evo-Stik League Northern Premier division.
He turned professional in July 2015 after coming through the academy, but is yet to play a game for the Mariners, who finished 14th this season.
However, Clifton has earned a new deal after impressing manager Russell Slade, who replaced Marcus Bignot in April.

BAM Nuttall handed over the project two years late in August 2011.
The council said it was left with £31m of defects on the St Ives to Cambridge route. It said while there were no safety concerns, the defects needed to be fixed.
No-one from BAM Nuttall was available to comment.
At a meeting of the general purposes committee, the council's technical advisers said the contractor should be held responsible for fixing problems including shallow foundations and inadequate drainage.
Although these were not dangerous, "ride quality would deteriorate" over time.
Councillors voted unanimously to begin legal action against BAM Nuttall.
It is estimated the repairs could take three years to complete.
The council originally paid BAM Nuttall £117.7m for its work.
However, last August after an on-going legal battle over the late delivery of the project, the company paid back £33m of that, reducing the cost to £84.7m.
The leaders of Northern Ireland's five main parties have gone head-to-head in a debate before Thursday's assembly election.
[NEXT_CONCEPT]
Midfielder Harry Clifton has signed a one-year contract extension with League Two side Grimsby Town.
[NEXT_CONCEPT]
The company which built Cambridgeshire's guided busway is to be "held to account" for the cost of defects, the county council has agreed.