Head coach Jesse Marsch insists neither Leeds nor Jack Harrison wanted the player to leave the club during the transfer window.
Harrison travelled to Leicester for talks with their manager Brendan Rodgers after the Foxes had made a reported late bid of £20million, but the deal fell through.
Marsch said the 26-year-old midfielder, who has 18 months left on his contract at Elland Road, will now sign a new deal with the Yorkshire club.
“In the 11th hour something came from Leicester,” Marsch said. “We’d been talking with Jack for quite a while about renegotiating his contract and it had gone well, but it had stalled at different moments.
“We’ve spent a lot of money in the last couple of transfer windows, I think very wisely, and we’ve invested very wisely.
“Before all the powers that be could get together from different angles, then in the 11th hour there’s some internal discussion in a lot of different ways on what’s best for everyone.
“But once it all came together it was clear that we wanted Jack to stay and Jack wanted to stay and that’s why he’s still here.”
Harrison is in his fifth season at Elland Road, having initially spent the first three on loan from Manchester City before Leeds paid £11m to make the move permanent in 2021.
Marsch did not reveal who had sanctioned Harrison’s possible sale or whether the player had had a medical at Leicester.
“I’m not sure of the exact details of that,” Marsch said. “But I was in constant contact with him and so was (Leeds director of football) Victor (Orta) and everyone else, and his agent was also helpful in the process to get Jack to stay.
“When offers come in, players have to consider what that might be and what that might look like.
“I don’t fault anyone for visiting the possibility of what it could be, but in the end, once we got all the decision-makers to align themselves, we all realised Jack has to stay.”
When asked if he thought Harrison would now sign a new deal, Marsch added: “Yeah, yeah. I think his head is really clear because it was a chance for everybody to express exactly how important he is to us.
“I wish my wife would show a vote of confidence in me the way we did to Jack these last 48 hours.”
Leeds will bid for their first Premier League win since November at relegation rivals Nottingham Forest on Sunday.
Marsch’s side, one point above the bottom three in 15th place, will be without striker Rodrigo, who has been ruled out for two months after fracturing his tibia and sustaining ankle ligament damage in last week’s FA Cup win at Accrington.
But new arrival Weston McKennie could make his full debut at the City Ground, with club record signing Georginio Rutter poised to make his first Premier League appearance.
United States midfielder McKennie, 24, has joined on loan from Juventus until the end of the season with a view to a permanent deal.