Aberdeen have secured the signature of Swindon Town striker Miles Storey, who has spent the season on loan to Inverness Caledonian Thistle.
The Dons stated on their website: "Miles Storey has agreed to join the club once his present contract with Swindon Town FC expires on 30 June."
Storey has scored 13 goals in 37 appearances for Aberdeen's Scottish Premiership rivals.
And they and Swindon both offered contracts to the 22-year-old.
Caley Thistle manager John Hughes stated in April that he believed the Englishman would like to stay at Caledonian Stadium.
Hughes also revealed that his club had paid "a healthy fee" to the Robins to extend the striker's loan beyond January.
Caley Thistle have since admitted an interest in bringing Billy Mckay back to to the club for a second spell.
The Northern Ireland striker was on loan to Dundee United from Wigan Athletic but has returned to the Latics following the Tannadice club's relegation to Scotland's second tier.
Aberdeen were looking for a replacement striker after Wales international Simon Church returned to Milton Keynes Dons at the end of a loan spell that produced six goals in 13 appearances.
Meanwhile, David Goodwillie, the former Scotland striker who had been sent on loan to Ross County in January, has been released by Aberdeen.
Storey came through the youth ranks at Swindon, but he only made nine first-team starts, although he made a further 28 appearances as a substitute, scoring six times.
He had loan spells with Salisbury, Shrewsbury Town, Portsmouth and Newport County before joining Caley Thistle in August after two brief Swindon appearances this season as a replacement.
However, last week the Robins revealed that they were still in negotiations with Storey about a new contract.
Striker Jon Obika also rejected a new deal with the League One club.
Find all the latest football transfers on our dedicated page.