Hundreds of inmates broke out of the main prison in Kandahar early Monday with the help of Taliban insurgents in a brazen tunnel escape that underscored huge failings in Afghan security.

Officials said more than 480 prisoners managed to flee the Sarposa prison over a four-hour period overnight.

Militants had apparently begun digging the tunnel five months earlier. The 300-metre-long tunnel from a nearby house went to a point underneath the cells, according to a statement issued by the Taliban.

The diggers broke through to the cells late Sunday night. One inmate told the Associated Press that he and other inmates had obtained keys from "friends," leading to speculation they had inside help.

"There were four or five of us who knew that our friends were digging a tunnel from the outside," said Mohammad Abdullah, who said he had been in the prison for two years for stockpiling weapons.

Inmates had keys

"Some of our friends helped us by providing copies of the keys. When the time came at night, we managed to open the doors for friends who were in other rooms."

The inmate said the militants quietly snuck out prisoners four or five at a time. His story could not be independently verified, but parts of his account were confirmed by government officials.

Qaril Yousaf Ahmadi, a Taliban spokesman, said more than 100 of the escapees were insurgent militants and commanders.

"After we took them out from there, we picked them up in our vehicles to send them out of the government-controlled area," Ahmadi said.

The mass escape prompted a huge manhunt around Kandahar. Afghan authorities claimed 26 escapees had been recaptured and two had been killed.

"Huge operations have been launched inside and on the outskirts of Kandahar city for the rest of them," said Tooryalai Wesa, a Kandahar governor.

Afghan policemen and NATO military forces stand guard next to the main prison in Kandahar on Monday following a mass escape engineered by Taliban insurgents. (Allauddin Khan/Associated Press)

An area around the jail was cordoned off.

A spokesman for Afghan president Hamid Karzai called the escape a "disaster" that shouldn't have happened.

"A prison break of this magnitude of course points to a vulnerability," said Waheed Omar.

The incident raised new concerns about how capable Afghan officials are in managing security in the volatile region.

The same prison was the scene of a mass outbreak in 2008. More than 900 inmates escaped following an attack by Taliban militants.

Afghan authorities supposedly beefed up security following that mass break-out, and Canada had helped to rebuild the facility after the 2008 attack.

A U.S. diplomatic cable obtained by the WikiLeaks website and released in November 2010 quoted then-CSIS head Jim Judd as criticizing Afghan President Hamid Karzai's leadership and response to security issues such as the Sarposa prison break.

The CBC's David Common reports that Canada still has two corrections workers based at Sarposa prison.