Motherwell have signed Dan Twardzik on a two-year contract after the 23-year-old goalkeeper left Dundee.
Well manager Stuart McCall told his club website: "Dan came in on loan at short notice and performed terrifically well earlier in the season.
"It coincided with one of our best-ever runs. We always had it in mind to bring him in and we are delighted he has chosen to sign for us."
McCall expects Twardzik, who had been signed on loan to cover for injuries to Gunnar Nielsen, Lee Hollis and Ross Stewart, to challenge for a first-team place next season.
Motherwell tried to sign the goalkeeper, born in the Czech Republic but who represented Germany Under-18s, in summer 2009 when he was leaving Bayern Munich.
Despite having trained at Fir Park, he joined Kalsruher then switched to Calcio Como in Italy before finally arriving in Scotland to sign for Aberdeen in 2013.
He was released after only six months at Pittodrie and it was not until he switched to Dundee that he made his first-team debut.
Even at Dens Park, Twardzik found himself second choice behind Kyle Letheren and it was not until his Motherwell loan spell, which coincided with five wins and three clean sheets, that he made his first-team debut.
He only managed two appearances back at Dundee before the end of his contract with the club promoted after winning the Scottish Championship.
A delighted Twardzik said: "I really enjoyed my time over Christmas and wished it could have been extended.
"It's a really good place to play your football; everyone at the club is so welcoming and the fans were superb with me.
"I really look forward to returning for pre-season, working with Gordon Marshall and hopefully pushing for a place in the starting 11 next season and beyond."
Dundee's website thanked Twardzik "for his efforts" and wished him well for the future.