There had been speculation that the 43-year-old would step down after his side's elimination from the World Cup.
McCarthy had come under immense pressure at the start of the competition after sending home his star player, Roy Keane.
The Yorkshireman was also said to miss the day-to-day involvement of club management and reports linked him with a move to the English Premiership.
But the Football Association of Ireland has revealed McCarthy has committed his future to the team.
An FAI spokesman said: "We are delighted that Mick has agreed to stay in charge for another two years.
Whatever happened prior to the tournament is finished - we moved on and go home with our heads held high
"We were aware he was seriously considering his position after the Roy Keane affair and it is good for Irish football that he is staying on."
Ireland went out of the World Cup on penalties to Spain in the second round on Sunday.
McCarthy told BBC's Match of the Day: "Whatever happened prior to the tournament is finished. We moved on and we can go home with our heads held high.
"The disappointment is huge - but we're looking forward to going home to our wives and families."
McCarthy took over from Jack Charlton as Ireland manager in February 1996.
And the former Millwall manager has a hugely impressive record.
He has suffered just two defeats in 23 competitive matches since the beginning of 1999 - away to Iran and Croatia.
McCarthy, who currently earns £300,000-a-year, is only the third manager Ireland have had in 22 years.
Eoin Hand was followed by Charlton in 1986, ushering in the most successful period in Irish football history.