Chris Coleman said the "honour" of leading his country was a deciding factor in signing a
The 43-year-old's future had been in doubt after months of delay in completing a new deal with the Football Association of Wales.
"People have spoken about whether I would sign a new deal," Coleman said.
"But I am delighted to extend it and I am looking forward to the challenges that will come."
The FAW confirmed Coleman's deal at a press conference in Cardiff on Friday, where he was flanked by president Trefor Lloyd Hughes and chief executive Jonathan Ford.
Coleman's first task is to lead Wales out in Saturday's friendly international against Finland at Cardiff City Stadium.
He had been linked with the managerial vacancy at Crystal Palace, but claimed he was never tempted to take the job and was not approached by the Selhurst Park club.
"The honour of doing the Welsh job is bigger than with any job I will ever do," he said.
"I have two years of experience in the job and we will be better for it.
"It has been really hard at times but at other times it has been fantastic and I don't want to hand that feeling on to someone else. I want to finish what I started with these players."
September defeats by Macedonia and Serbia added to a disappointing World Cup qualifying campaign, but the Dragons finished the campaign with a win over Macedonia and an excellent draw away to group winners Belgium.
Coleman, the former Fulham, Real Sociedad, Coventry and Larissa boss, will now remain in charge of Wales for the Euro 2016 qualifying campaign.