KABUL (Reuters) - Two Taliban suicide bombers on Thursday killed at least 27 people and wounded around 40 in an attack on buses carrying newly graduated cadets on the western outskirts of Kabul, officials said.

The attacks underline the threat to security in Afghanistan about a week ahead of a NATO summit in Warsaw, where leaders are expected to discuss whether to maintain support for the Kabul government 15 years after the Taliban were driven from power.

The green buses, clearly identifiable as police vehicles, were attacked and partially destroyed as they approached the capital from neighboring Wardak province, leaving debris strewed across the road.

An Interior Ministry official said at least 27 people were killed and 40 wounded in the attack during Islam’s holy month of Ramadan. In a statement, the Taliban said around 150 police had been killed and dozens more injured.

Taliban spokesman Zabihullah Mujahid said the first attack targeted a bus carrying police cadets and instructors. Then, as rescuers and emergency services arrived, a second bomber rammed his car, packed with explosives, into their vehicles, killing dozens.

The attacks were immediately condemned by NATO’s Resolute Support mission in Afghanistan as well as President Ashraf Ghani, who called the incident a “crime against humanity”.

“While Muslims are busy praying during this holy month of Ramadan, Taliban keep committing reprehensible crimes by killing innocent people and spreading fear and terror,” he said in a statement.

Slideshow ( 14 images )

He ordered an inquiry into how the Taliban could mount an apparently carefully planned operation, despite pledges of a security clampdown in Kabul following recent attacks.

Beyond the immediate impact, the attacks cast further doubt on any resumption of peace talks with the Taliban.

Even before the death of former leader Mullah Akhtar Mansour in a U.S. drone strike last month, prospects appeared remote after the Taliban refused to join talks sponsored by the United States, China and Pakistan.

Under new leader Mullah Haibatullah Akhundzada the insurgents have made clear they will continue attacks on the Western-backed government, and maintained their demand for international forces to quit the country.

Last week, the top U.N. official in Afghanistan warned of the danger of a new spiral of violence following recent suicide attacks and highway kidnappings.

The latest suicide bombings come 10 days after 14 people died in an attack on a bus carrying Nepali security guards working for the Canadian embassy in Kabul.

In April, 64 people were killed in a Taliban attack on a security services facility in Kabul, the deadliest such bombing since 2011.