Striker Stevie May has completed his protracted return to St Johnstone after having his Aberdeen contract cancelled.
May seemed set to rejoin his hometown club - five years after leaving for Sheffield Wednesday - in July after a medical, only for the move to falter.
However, the 26-year-old, who scored 32 times in 81 games in his previous Perth spell, has now signed a two-year deal with the option of a further 12 months.
"Stevie's motivation to come back kept us going," said manager Tommy Wright.
"It has taken a long time but we're really pleased. The chairman has worked so hard to get it back on track and over the line.
"I want the Stevie May of old. His goals may have dried up in recent years, but a goalscorer is always a goalscorer and Stevie has proved he can do it at this level."
May was part of the St Johnstone side that won the 2014 Scottish Cup by beating Dundee United 2-0 in the final at Celtic Park, scoring 27 times in total that season.
However, he has not played for Aberdeen this season after only finding the net three times in 41 games last term.
"It's brilliant to eventually get it over the line," May said. "It's nice to walk in the stadium and see familiar faces where I pretty much grew up.
"Tommy has made no secret of the fact he wanted me and that was a big thing. Hopefully we can have more success like we did in the past, especially for the fans."
Aberdeen manager Derek McInnes said: "Stevie worked extremely hard and gave everything in his time with us. I wish him well in his next opportunity."