Peterborough United have completed the deal that will see striker Dwight Gayle join the club permanently in January.
Gayle has scored five goals in six appearances since joining Posh on loan from Dagenham & Redbridge, with the two clubs agreeing on a fee of £500,000 for his services.
The 22-year-old has netted in each of Peterborough's last four games, and manager Darren Ferguson was keen to tie him down to help in their battle to avoid relegation.
"Dwight has done very well, and him and Lee Tomlin have formed an effective partnership," Ferguson told the club's official website.
"They have caused a lot of problems and long may that continue. I am pleased that everything has been sorted out and credit to the chairman for providing the finance for the deal."
The player was pleased to conclude the deal that sees him move up two divisions.
"I am delighted that everything went well, I have really enjoyed my time at the club during my loan spell and I am very pleased to be staying.
"I want to improve and I believe I can do that here."