Wigan Warriors legend Shaun Edwards will return to the Super League club as head coach in 2020, after Adrian Lam takes the job for a season.
Edwards will take charge of the club - where he spent 14 years and won every available honour - after fulfilling his commitments as Wales' defence coach at the 2019 Rugby World Cup.
Current coach Shaun Wane is joining Scotland Rugby later this year.
Ex-Papua New Guinea coach Lam spent three years a Wigan player from 2001.
Wigan Warriors chairman Ian Lenagan said he was "delighted" 51-year-old Edwards had signed a three-year contract.
"He is a legendary figure in both codes of rugby as a supremely gifted player and as a highly successful coach," he added.
"He is an inspirational figure, a born leader and a winner at everything he has turned his attention to."
Wane, 53, will depart Wigan with an impressive coaching CV, including two Super League titles, a Challenge Cup and three World Club Challenge wins.
Lam, 47, most recently worked with Sydney Roosters at age-group level, and as head coach at Cronulla in Australia's National Rugby League.
He also worked as under-20s coach at Wigan earlier in his career.
But it is the appointment of 51-year-old Edwards that will create the most interest outside of rugby league.
Since turning to coaching, Edwards' greatest achievement was to lead Wasps to Heineken Cup glory in 2007, having previously been involved as Warren Gatland's assistant.
Wigan-born Edwards followed Gatland to work in the Wales set-up - and again as part of the New Zealander's British and Irish Lions backroom team.
It is 18 years since he last worked in professional rugby league, after retiring from playing in 2000.
Edwards was linked with the vacancy at Warrington, before Steve Price was handed the job to succeed Tony Smith, and previously expressed his interest in returning to the 13-man code.
'The biggest signing returns' - analysis
BBC Sport rugby league correspondent Dave Woods
The return of Shaun Edwards will provoke a strong emotional response from Wigan fans - albeit they'll have to wait 12 months before he arrives.
Edwards' signing as a player by Wigan - on his 17th birthday in October 1983, live on BBC TV's Breakfast programme - was arguably the biggest signing in the club's modern history.
It was the start of Wigan's emergence as the pre-eminent side of the 1980s and '90s. Prior to that, the best local stars were being snapped up by the then bigger clubs such as Widnes and Warrington.
Schooled at the local amateur club Wigan St Patricks, Edwards went on to become the most decorated player in rugby league. His massive haul of silverware included a record-breaking nine Challenge Cup winners' medals.
He played in not just every final, but in every round of Wigan's eight-year domination of that competition between 1988 and 1995.
But for all that he was general and a leader on the field as a player, and for all his success in rugby union as a coach, he has no frontline coaching experience in rugby league. He will hope to hit the ground running.
In the meantime, the man who will be keeping the seat warm before Edwards' arrival is also likely to be a popular choice amongst Wigan fans. Adrian Lam left enough of an impact in his four years at the club as a highly talented scrum-half to be considered "one of our own" by Warriors supporters.
What will Lam inherit?
Exactly what he will walk into at Wigan will be determined by what happens between now and the end of the campaign, with Warriors in second place going into the Super 8s section of the season.
What is certain for the former PNG playmaker is the departure of several key players. England internationals Sam Tomkins and John Bateman are off to Catalans and Canberra respectively, with Ryan Sutton joining Bateman in the Australian capital.
That said, there is a core of highly rated home-grown players which Wane has helped establish in first-grade rugby, such as wingers Tom Davies and Liam Marshall and centre Oliver Gildart.
'A great servant to Welsh rugby'
Wales Rugby Union (WRU) chairman Gareth Davies said: "We would like to congratulate Shaun on his appointment at Wigan Warriors.
"He is a rugby league legend and particularly so at Wigan and we know he will be welcomed back there with open arms.
"From a Wales perspective entering a crucial world cup year it is great that Shaun has committed to seeing out his contract with the WRU and to continue to help lead Wales into the world cup.
"Shaun has and continues to be a great servant to Welsh rugby. He has been part of a hugely successful coaching team over the past ten years and we would like to thank him for all of his efforts.
"I am sure I speak on behalf of the whole game in Wales when I say I wish him all the best for his future."