Shrewsbury Town chairman Roland Wycherley has confirmed that Gareth Ainsworth is set to leave the club.
Reports emerged on Tuesday that the 51-year-old had agreed to take charge at Gillingham, who have since confirmed the departure of interim boss John Coleman.
Ainsworth took charge of the Shropshire club in November but has been unable to guide them off the bottom of the League One table.
An official statement read: “I can confirm that the club has done absolutely everything in its power to persuade Gareth to stay. Failing that, we also asked if he would continue until the end of the season.
“Gareth’s contract contained a termination clause which the League Two club in question initially refused to meet.
“We made clear from that point we would not allow him to leave and that we wanted him to honour the remainder of his contract.
“But Gareth made clear he wanted to leave immediately, despite acknowledging the position the club are in at this moment in time.
“At a board meeting yesterday afternoon, the League Two club had still refused to meet the termination clause. But at 4.41pm yesterday, STFC received confirmation that the club had agreed to pay the full termination fee for both Gareth Ainsworth and Richard Dobson.
“This took any further negotiations out of our hands – and Gareth and Richard once again expressed their desire to leave immediately.”
Wanderers came from behind to win 3-2 at Shrewsbury last month thanks to Eoin Toal and John McAtee’s brace.
The statement added: "A few weeks ago, I sat down with Gareth and offered him a two-year contract extension regardless of our divisional status because, as a club, we were excited about the future with him at the helm.
“Gareth seemed pleased we made that offer and everyone was looking forward to a long and mutually beneficial relationship.
“While we only received the final paperwork from the League Two club this afternoon, I would like to – as much as possible – reassure fans that we are already in discussion with suitable candidates for the head coach role."