KABUL – The Taliban captured the strategic northern Afghan city of Kunduz on Monday in a multi-pronged attack involving hundreds of fighters, the first time the insurgents have seized a major urban area since the 2001 U.S.-led invasion.

The fast-moving assault took military and intelligence agencies by surprise as the insurgents descended on the city, one of Afghanistan’s richest and the target of repeated Taliban offensives as the militants spread their fight across the country following the withdrawal last year of U.S. and NATO combat troops.

Within 12 hours of launching the offensive around 3 a.m., the militants had reached the main square, tearing down photographs of President Ashraf Ghani and other leaders and raising the white flag of the Taliban movement, residents reported.

More than 600 prisoners, including 140 Taliban fighters, were released from the city’s jail, and many people were trying to reach the airport to flee the city.

“Kunduz city has collapsed into the hands of the Taliban,” Interior Ministry spokesman Sediq Sediqqi told the Associated Press. “Security forces in Kunduz were prepared for an attack, but not one of this size, and not one that was co-ordinated in 10 different locations at the same time.”

The Taliban used social media to claim the “conquest” of Kunduz and reassure residents that the extremist group — responsible for the vast majority of nearly 5,000 civilian casualties in the first half of this year, according to the United Nations — came in peace.

A statement attributed to the group’s new leader, Mullah Akhtar Mansoor, the self-styled Islamic emir of Afghanistan, said: “The citizens of Kunduz should not worry about safeguarding their lives and properties. Carry out your ordinary livelihoods in absolute security. All traders, workers, staff of hospitals, municipality and governing bodies should continue their daily routines without any fear or intimidation.”

The Taliban have a history of brutality toward those they regard as apostates, and have banned girls from school as well as music, movies and other trappings of modern life in areas under their control.

The fall of Kunduz marks a major setback for government forces, who have struggled to combat the Taliban since the U.S. and NATO shifted to a supporting role at the end of last year.

The city is a strategic prize for the Taliban and its capture, however short-lived, is sure to be used as a propaganda victory. This year’s fight has severely tested Afghan forces, who lack air power and must rely on the United States for selective airstrikes, and suffer huge casualties and low morale. Nevertheless, they have largely held their ground in the face of a Taliban strategy clearly aimed at forcing them to spread resources ever-thinly across the country.

Sediqqi said military reinforcements were being sent to Kunduz, where government forces managed to fend off a major Taliban assault in April, the start of the insurgents’ annual summer offensive. “We are trying our best to clear the city as soon as possible,” he said.

Kunduz has been regularly targeted by the Taliban, who have allied with other insurgents, including the Islamic Movement of Uzbekistan and militants driven into Afghanistan from neighbouring Pakistan by an assault on their hideouts near the porous border.

Gen. Murad Ali Murad, the deputy chief of army staff, said Monday’s attack involved a large number of Taliban drawn from across the north and included foreign fighters, likely Islamic Movement of Uzbekistan members with an eye on the Central Asian states to Afghanistan’s north.

“Strategic areas, including the airport, are controlled by Afghan security forces,” he said. “Reinforcements have already arrived and attacks on the insurgent positions will be launched soon,” he added, without elaborating.

Sediqqi said the target of the Taliban assault was the city’s main prison and police headquarters.

Earlier, deputy presidential spokesman, Zafar Hashemi, had called the situation “fluid,” saying Ghani was “in constant contact with the security and defence leadership to provide them with guidance.”

“Our first priority is the safety and security of residents,” he said.

Analyst Faheem Dashty said Afghan security and intelligence agencies had been “caught by surprise” in what appeared to be a “big failure” of security and intelligence.

“They were expecting a big attack but couldn’t defend the city,” he said.

Authorities were similarly blind-sided by the April attack and subsequent massing of fighters across the northern provinces, raising questions about the adequacy of the government’s security and defence agencies.

A senior U.S. defence official, speaking on condition of anonymity in order to discuss an ongoing military operation, said the U.S. military was aware the Taliban had taken control of a hospital and a number of government buildings in the city, and that both sides — the Taliban and government forces — had sustained a significant number of casualties.

Early indications were that the Afghan forces were in position to push back the attackers and regain control of the city, although the outcome was still in doubt, said the official, speaking earlier Monday before the government announced the fall of the city.

The Kunduz assault highlights the resilience of the Taliban following the revelation earlier this year that their reclusive longtime leader, Mullah Mohammad Omar, died two years ago. A bitter internal dispute over the appointment of Mansoor has yet to be fully resolved, but seems to have had little impact on the battlefield.

__

Associated Press National Security Writer Robert Burns in Washington contributed to this report.