Wolves and Huddersfield were other potential destinations for the Yorkshireman but chairman Ken Bates wasted no time in getting his man on a contract to the end of the 2012-13 season.
Grayson, 42, was relieved of his duties on February 1 after Leeds dropped to 10th place in the Championship. Bates is determined to see the Whites seal a return to the Premier League.
The former Chelsea supremo said: "We believe the appointment is arguably the most important we have made. The objective was to appoint a manager who had for a proven track record of getting teams promoted and in Neil we have a man whose record is second to none. We want to be in the Premier League and we will support Neil in the quest to get us there."
The club's new manager said: "I feel I have one big challenge left in me and believe Leeds is a club that should be in the Premier League. I want to be the man who is able to deliver this for a set of fans who never cease to amaze me with their numbers and their loyalty.
"Having met with Ken Bates it was an easy decision to take up the challenge and with his support, we share the same vision of getting Leeds United in the Premier League."Seculation about Warnock's immediate future intensified when he was photographed with Bates outside a cafe in Monte Carlo, discussing the deal.
Warnock became the frontrunner for the job when it emerged that Mick McCarthy wished to have a short break from management after his dismissal by Wolves.
Warnock's pedigree is impressive when it comes to getting clubs promoted to the top flight. He has masterminded seven promotions in total, including three into the top-flight - most recently QPR last season.
Caretaker Neil Redfearn, who has overseen two Leeds defeats in three games, remains in charge for Saturday's game against Doncaster Rovers, and will return to his role with the club's Academy next week.