Glasgow coach Dave Rennie will take charge of Australia next summer – with Scotland forwards coach Danny Wilson replacing him at Warriors.
New Zealander Rennie, 55, confirmed his interest in the post last month, having said in April he was keen to head nearer home for family reasons.
He replaces Michael Cheika, who resigned after Australia’s Rugby World Cup quarter-final defeat by England.
Glasgow announced Wilson as Rennie’s replacement on Wednesday morning.
“The opportunity to coach such an attractive club as Glasgow Warriors was too good to miss,” Wilson, 43, said.
Rennie, who had also been linked with the vacant New Zealand post, told BBC Scotland last week he was “pretty close to making a decision” on his future.
His recruitment on a three-and-a-half year contract has been described by Rugby Australia as “a massive coup” and he will assume responsibilities next July.
“We’ve loved our time here around great people. It’s been as good as I could have wished for after leaving New Zealand,” Rennie told the Glasgow Warriors website.
“It’s an exciting opportunity to coach at international level and an added bonus that we’ll be a little closer to home, near our kids and grandkids.
“All my focus is on the rest of the season in Glasgow as we strive to be in the mix come play-off time in both comps again.”
In Rennie’s first season, Glasgow reached the Pro14 semi-finals and made the final last term, as well as reaching the European Champions Cup quarter-finals.
They won their opening game in that competition this season against Sale Sharks last weekend and travel to face Exeter Chiefs on Saturday.
Scottish Rugby chief executive Mark Dodson thanked Rennie for “the contribution he’s made to the development” of Glasgow since joining from Super Rugby club Chiefs in 2017.
“He enhanced the strong, positive culture at Scotstoun and pushed the team to achieve significant results, playing some outstanding rugby on the way,” Dodson added.
“He has conducted himself throughout with great professionalism and I know he will want to sign off his time in Glasgow with some silverware. We wish him well for the future.”
Wilson, meanwhile, became part of the Scotland staff in August 2018 after three years as Cardiff Blues head coach which included winning the European Challenge Cup.
He previously had spells as forwards coach at Welsh Pro14 sides Scarlets and Dragons, combined with two years in charge of Wales Under-20s, before a season at Bristol.
“We are very pleased Danny has accepted this important role at Glasgow Warriors as it retains an excellent coach within the Scottish professional game,” Dodson said.
“Danny has worked hard to develop Scotland’s set-piece into a real area of strength and his technical expertise, aligned with his working knowledge of many of the Warriors’ players, will be key to maintain the club’s progression.”
‘Wilson will be welcomed by players’ – analysis
BBC Scotland rugby reporter Andy Burke
Having been linked with Australia for the best part of a year, Rennie’s appointment comes as no surprise. There was a brief period when he emerged as a contender for the All Blacks job, but former SRU director of rugby Scott Johnson – who’s now in a similar role with Australia – identified Rennie as his top target long ago and has got his man.
Wilson, the man chosen to replace Rennie in the top job at Scotstoun, is a popular figure with many in the Scotland squad and his appointment will be welcomed by the players. However, there may be some Warriors fans who would have expected a higher-profile name.