Kyle Lafferty has returned to Rangers after Hearts accepted an improved offer for the Northern Ireland striker.
The 30-year-old, who spent four years at Ibrox from 2008 to 2012, has signed a two-year deal at Ibrox.
Rangers had a bid of £200,000 rejected in July for the forward, who scored 20 goals after joining Hearts last summer.
"When a player has his mind fully set on moving, it is difficult to reach an alternative conclusion," said Hearts owner Ann Budge.
"It is no secret that this has been a particularly difficult and drawn-out affair. But the deal will suit all parties."
Lafferty could make his debut in Thursday's Europa League qualifier against FC Ufa at Ibrox, with clubs permitted to register two 'wildcard' signings the day before a Uefa competition fixture.
Speaking before the deal was announced, Rangers manager Steven Gerrard said if it was completed in time "of course he will be available and involved".
'What Hearts have done for me is superb'
After Rangers' initial bid was rejected, Lafferty conceded the lure of a return to Ibrox was strong, while acknowledging the support Hearts have given him in dealing with a gambling addiction.
"I think everyone knows I'm a Rangers supporter," he told BBC Scotland after scoring the winner against Celtic earlier in August.
"What Hearts have done for me has been superb," Lafferty added. "Hopefully I've repaid them with the goals."
He scored 20 in his 48 appearances for the Edinburgh club, who he joined from Norwich after spells with Sion in Switzerland and Palermo in Italy.
Lafferty, who began his career with Burnley and has won 67 caps for Northern Ireland, handed his shirt to a young fan at the end of last Saturday's League Cup win at Dunfermline Athletic, after coming on as a substitute in what proved his final Hearts outing.
He becomes Steven Gerrard's 12th signing since taking over at Ibrox this summer.
'Lafferty scores important goals' - analysis
Former Rangers captain Lee McCulloch
He gives you so many options. He can play on his own and he could possibly be a great foil for Alfredo Morelos. He's got pace, he can stretch a defence, and he has presence. I don't see him as a prolific goalscorer but he scores important goals and I think that's what Rangers need.
Former Celtic striker Scott McDonald
I wouldn't imagine he would play every week, but the beauty of Kyle though is he can play in the wide areas as well, which helps the squad. He can fill in somewhere and cause chaos. I think he will be a great addition.