Kabul, Afghanistan (CNN) -- Hundreds of inmates, many of them insurgent fighters, slipped out of a southern Afghanistan prison early Monday through a nearly quarter-mile tunnel dug beneath the compound from the outside.

The Taliban issued a statement taking responsibility for the escape from the prison in Kandahar, the Taliban's birthplace. Taliban spokesman Zabiullah Mujahed said digging the tunnel took five months. The escape took four and a half hours, he said.

The Taliban claimed 541 prisoners escaped. The NATO-led International Security Assistance Force said the number of escaped prisoners was closer to 470. The Taliban said 106 of the escapees were military commanders, but there was no immediate government confirmation of the claim.

Police recaptured eight of the escapees, the Kandahar governor's office said.

Monday's break was the second dramatic escape at the prison in three years. In 2008, as many as 1,000 prisoners -- nearly half of them Taliban members -- escaped after militants detonated a truck bomb against the side of the prison compound.

The prison houses some of the country's most dangerous Taliban prisoners, and the escape was an embarrassment for the Afghanistan government and its Western allies, according to CNN National Security Analyst Peter Bergen.

"It's, I think, quite a black eye for the U.S. and NATO and the Afghan government, who have put quite a lot of resources into trying to improve the prison systems, and here you have this massive prison break, with sadly, some pretty hardcore Taliban prisoners who escaped," he said.

Waheed Omer, a spokesman for Afghan President Hamid Karzai, called the mass escape "bad news and a disaster."

Although the Taliban said some of the escapees were military commanders, it's unlikely the escape will have a significant impact on military operations in Afghanistan, said Thomas E. Gouttierre, director of the Center of Afghanistan Studies at the University of Nebraska in Omaha.

"I don't think I would see this as a big blow to Western efforts in Afghanistan," he said.

Instead, he said Afghanistan's government is likely to bear the brunt of criticism for failing to anticipate or prevent the escape, especially after previous escapes at this and other prisons.

In the 2008 escape, militants used a truck loaded with about two tons of explosives and driven by suicide drivers to blast holes in the mud brick walls of the prison.

A gun and rocket battle followed, lasting several hours and ending with militants rushing into the prison on motorcycles to free prisoners, according to Taliban accounts of the attack.

Nine guards, seven prisoners and one civilian were killed in the attack, according to the provincial government.

Security forces said they tried to track down the escaped prisoners, but said the large Taliban presence in the region and the numerous hideouts located there made it difficult to hunt down militants.

Kandahar is the birthplace of the Taliban and has been the site of fierce fighting between international forces and insurgents.

It has been the site of numerous anti-Western demonstrations, recently over the burning of the Quran, Islam's holy book, by a pastor in the United States.

On April 15, the police chief of Kandahar province was killed when a man wearing a military uniform detonated a bomb at the entrance to the police headquarters.

In February, 10 people died when mines exploded at a playground during a picnic hosted by a former police commander. In a separate incident, 19 people, including 15 police officers, died when armed attackers targeted police headquarters.

After attacks on the country's ministry of defense, the assassination of the police chief and now Monday's prison break, Kandahar resident Kari Ghar said it's "impossible to call this system a government."

"This is the worst possible weakness of the Afghan government that almost every single political prisoners escape from the central jail in Kandahar," Ghar said.

CNN's Nick Paton Walsh contributed to this report.