Sinn Fein's outgoing education minister battled to the wire to take the last seat in Upper Bann.
John O'Dowd's disregard for academic selection and combative style alienated many in this largely unionist constituency.
But his party's daring gamble in fielding an extra candidate paid off after the tightest of races when he edged out SDLP stalwart Dolores Kelly who has given 23 years to public service.
Mr O'Dowd said: "It is an historic victory for Sinn Fein. It was down to the wire at the very end.
"Catherine (Seeley) and I have worked hard for this seat the past four years.
"The people have spoken, democracy has prevailed and myself and Catherine are elected."
The minister has been a safe pair of hands for Sinn Fein in the Executive, the political bruiser his party turned to during the many crises to hit powersharing.
He appeared lost in thought and his hulking frame sagged slightly at the end of two long days of counting, with Upper Bann the last constituency to declare.
Mr O'Dowd trailed party colleague Ms Seeley, who shot to prominence after she was targeted for sectarian abuse at a North Belfast school in 2014.
But in a constituency where nationalist transfers were few and far between the veteran scrapper prevailed.
Poll topper Carla Lockhart of the DUP wore the light-blue scarf of her beloved Glenavon - who played Irish Cup final football on Saturday - before the final results were declared.
But Ulster Unionist Jo-Anne Dobson's celebrations with her family were tinged with sadness for successful running mate Doug Beattie.
The army veteran of Afghanistan and Iraq was elected as he attended the funeral of his 15-month-old grandson.
Mrs Kelly put her loss into perspective.
"Doug Beattie buried his grandson. I am going home to my grandchildren."