The new Irish Football Association deal will extend O'Neill's tenure as manager of his country up to and including the 2016 European Championship should the Irish qualify.
O'Neill was appointed national boss on February 1, 2012 after Nigel Worthington left the role and guided the team to fifth in their six-team 2014 World Cup qualifying group, suffering a humiliating loss to Luxembourg along the way.
They have won just once in 14 matches under O'Neill, a 1-0 Belfast victory over Russia in August, but the Irish FA is convinced he is the right man for the job.
O'Neill's side face Turkey in a friendly later this month and O'Neill said: "When I was appointed Northern Ireland manager I was honoured to have been chosen to manage my country; and I am extremely happy to have agreed a new two-year deal with the Irish Football Association.
"I have said all along that I would like to continue in the role - I think there has been a major transition in the team; it's a very young squad, but a squad which has developed during the last campaign, with several young players of quality emerging; and I am now looking forward to taking the team into the European Championship qualifiers."
Irish FA president Jim Shaw said: "I am delighted that Michael has agreed a two-year extension to his contract. I have no doubt that he will be able to build on the work he has already done and will take us forward in the Euro 2016 campaign.
"Michael is a true professional who has passion and pride - something which he showed as a player for his country and now as a manager and I believe he is the right man for the job of Northern Ireland manager."
O'Neill named a strong squad for the Turkish trip, with experienced defenders Jonny Evans, Aaron Hughes and Gareth McAuley all included.
Manchester United defender Evans has been battling back trouble and will be suspended for the start of Euro 2016 qualifying, but has been included in the 20-strong party.
There is no place for Palermo's Kyle Lafferty, who has not been back in the squad since his red card against Portugal in September.
NI squad for Turkey friendly (Nov 15, in Adana): Carroll, Mannus, McAuley, J Evans, Hodson, D Lafferty, McArdle, Hughes, Baird, Davis, Norwood, Ferguson, Brunt, Clingan, O'Connor, McKay, Paterson, Ward, McGinn, Grigg