St Mirren boss Oran Kearney admits it is best for all concerned if Buddies number one Craig Samson retires and moves to Sunderland now.
The Paisley outfit have confirmed the goalkeeper has hung up his gloves after accepting a Black Cats coaching role under former Saints boss Jack Ross.
The 34-year-old has made 17 appearances for Kearney's strugglers this term while back-up stopper Danny Rogers has been injured for most of his time at the club since moving on loan from Aberdeen.
But the Irishman has refused to stand in Samson's way, even though he only has former Hearts and Blackpool keeper Dean Lyness as cover in goal.
"First and foremost, we'd like to thank Craig for his magnificent service to the club," said Kearney in a statement on the St Mirren website.
"He's been a great character and an ultimate professional in my time at the club and goes with our best wishes.
"We discussed the option of Craig staying until January, but we feel it is in everyone's best interests that he takes up his new role with immediate effect."
Samson started his career with Kilmarnock and joined Saints in July 2010.
The former Scotland squad member made over 150 appearances for the Buddies over two spells, helping the Paisley outfit lift the League Cup in 2013 before last season's Ladbrokes Championship triumph.
Samson added: "I'd like to say thank you to the St Mirren fans for the way they've treated me and my family.
"It's the best club I have ever been at. The way they have treated me, and everyone associated with me, has been absolutely amazing.
"I know it's not ideal timing, but it was an opportunity I couldn't pass up on.
"We had talked about the option of staying until January and playing until then but we all agreed it was best that we let the club go on.
"I hope the club can do really well and stay in the division as they really deserve it."
As part of the move, Sunderland have agreed to play a pre-season friendly at the Simple Digital Arena next summer.