Gareth Ainsworth has left Wycombe Wanderers after more than a decade in charge to become head coach of Championship club Queens Park Rangers.
The 49-year-old has agreed a three-and-a-half-year contract and replaces Neil Critchley, who was sacked after just 12 games in charge.
He will be replaced at Wycombe by Colchester boss Matt Bloomfield, who has “agreed in principle” to return.
Bloomfield, 39, left Adams Park in September to take charge of the U’s.
Ainsworth spent almost seven years as a QPR player before joining Wycombe in 2010, becoming their manager two years later.
Before his exit, he was second in the list of longest-serving managers in England’s top four divisions.
Only Harrogate’s Simon Weaver had been at the helm for a longer period than Ainsworth, who leaves the Chairboys seventh in League One, just three points outside the play-off places.
“This is all a little bit surreal. It has been a whirlwind two days and leaving Wycombe Wanderers was very tough because of the connection there,” he said.
“This is going to be a real challenge because the club is so special to me, and so huge as well. I want to get Loftus Road absolutely rocking again.”
Ainsworth is QPR’s third full-time head coach this season.