Wayne Pivac has left his position as Wales head coach and will be replaced by his predecessor Warren Gatland.
Gatland will take charge of next year's Six Nations and Rugby World Cup, and potentially the 2027 tournament.
The decision follows a Welsh Rugby Union review into a dismal autumn campaign, which included a first loss to Georgia.
Former Scarlets coach Pivac took over from fellow New Zealander Gatland after the 2019 Rugby World Cup.
But during the 60-year-old's final year in charge, Wales only won three out of 12 games.
Gatland is Wales' most successful and longest-serving coach, having won three Grand Slams during his 12-year reign. He also guided Wales to the semi-finals of the 2011 and 2019 World Cups.
In his final season, Wales reached the top of World Rugby's rankings having recorded a 14-match unbeaten run.
Gatland departs Super Rugby side the Chiefs to return to Wales before Christmas.
Pivac's three year tenure saw Wales slip to ninth in the rankings, having won 13 games, lost 20 and drawn one.
2022 was a particularly disappointing year in which Wales suffered home defeats to Italy in the Six Nations and Georgia last month.
His highlights include a 2021 Six Nations title and a first a Test victory on South African soil in the summer.
Gatland said he was "very much looking forward to returning", with his immediate priorities the Six Nations and World Cup.
"This is an opportunity to achieve something with a talented group of players in a country so passionate about rugby," he said.
"A country which made my family and I so welcome, when we first arrived 15 years ago, and all the time we were there.
"There is little time for sentiment, professional sport is all about preparation, values and results. There will be new challenges as there always is with a change in head coach, but for me the environment, the players and their families will always come first.
"We must prepare to the best of our ability in the time available. We will value and respect each other, we will work hard and, if we get this right together, performances and results will follow."
Pivac said he was "extremely sad" to stand down after what he called a "speedy review process" of the autumn campaign.
"Unfortunately, the results or performances this year were not all as we hoped. As a group we all take responsibility for that, but me in particular as head coach," he said.
"We have played some really good rugby at times, but needed to do that more consistently. However, I know that there is a strong foundation for the squad to progress to great things in the future.
"I would like to thank the players, coaches, management and the WRU for their commitment, support and hard work in my time as head coach and to all the people in Wales for making me feel at home here over the past eight years."
The WRU's chief executive officer Steve Phillips said it had been a difficult decision to make, with Wales kicking off their World Cup campaign in just 10 months.
"This is one of the toughest calls to make in sport, but the review process has reached its conclusion and we have acted quickly and efficiently in the very best interests of our national team," he said.
"Ultimately we are in the results business and we have agreed with Wayne that the current trajectory for Wales is not where we want it to be.
"We thank him sincerely for his time, enthusiasm, diligence and effort, which is unquestioned, as head coach over the last three years."
Phillips added they are bringing back "one of the very best coaches" in Gatland and they are "extremely excited" about this latest chapter.
"We were sorry to see him go when he left and we are delighted that he has agreed to return.
"He will undoubtedly be able to make an immediate impact, just as he did when he joined us for the first time in 2008.
"But it has also been important to both parties to ensure we get absolute maximum gain out of the return of such an experienced and highly regarded individual.
"It is for this reason that we are particularly pleased to have been able to secure Warren's services for the next few years with the ability to go to the 2027 Rugby World Cup.
"This appointment is no quick fix, nor sticking plaster, it is part of our long term planning for the game in Wales."