"The tunnel is 10-feet deep and about 45 meter long and runs under road before ending up near the jail," Colonel Tahir Mehmood of Sindh Rangers said.
He said that the militants were just 10 metres short of their planned 55 metre long tunnel when the Rangers official foiled their attempt.
Several people involved in the failed attempt were arrested and being interrogated, he said without divulging further details.
The militants had bought a house near the central Jail a year ago and were using it to dig a covert tunnel to reach the prison where some high profile Taliban inmates have been kept.
In 2012, they attacked a jail in Bannu city in the restive northwest region and managed to release about 400 inmates.
Last year, they stormed a jail in Dera Ismail Khan near Bannu city and released around 250 people.