After the Welsh side moved to within six points of Championship leaders Wolverhampton Wanderers, reports suggested that the 69-year-old was close to extending his stay at the Cardiff City Stadium.
Warnock had been under contract until the end of the current campaign, but Cardiff have revealed that they have now agreed fresh terms with the veteran boss.
Chairman Mehmet Dalman told the club's official website: "This is excellent news for everyone connected with Cardiff City football club.
"Since taking the reins at Cardiff City Stadium, Neil has transformed the fortunes of the side. His excellent work has helped us to compete at the very top of the division this season and we are all tremendously excited to see what the next two years will bring."
Warnock has recorded 37 wins and 17 draws from his 75 matches in charge.