Dozens of passengers, mainly women and children, were killed in western Afghanistan early on Wednesday when the bus they were travelling in hit a roadside bomb, officials said.

The attack, which came one day after the UN said Afghan civilians are being killed and wounded at a “shocking” level and as the country gears up for presidential elections, occurred around 6am (0130 GMT), authorities said.

“A passenger bus travelling on the Kandahar-Herat highway hit a Taliban roadside bomb. So far at least 28 have been killed, 10 wounded,” said Muhibullah Muhib, the spokesman for Farah province.

All were civilians, mostly women and children, he said.

Sediq Sediqqi, a spokesman for the Afghan presidency, put the toll slightly higher at 34 killed and 17 wounded, also blaming it on the Taliban.

There was no immediate confirmation from the insurgents that they were behind the blast.

The group, which has resurged since its regime was toppled by the US invasion in 2001, made a vague pledge last month to reduce civilian casualties.

Civilians have long paid a disproportionate price in the nearly 18 years since the US invaded Afghanistan.

On Tuesday, the UN released a report showing that casualties have dropped 27 per cent in the first half of this year compared to the same period last year, which was a record – but nonetheless 1,366 civilians were killed and another 2,446 injured.

Child casualties represented almost a third of the overall total of civilian casualties.

The UN also said that US and pro-government forces caused more civilian deaths than the Taliban and other insurgent groups for the second quarter running.

It branded efforts to reduce the violence “insufficient”.

The bloodshed is expected to intensify now that official campaigning for Afghanistan’s presidential election, set for September 28, is underway.

At least 20 people were killed on Sunday, the first official day of the campaign, and 50 wounded when a suicide attacker and gunmen targeted the Kabul office of Afghan President Ashraf Ghani’s running mate, Amrullah Saleh.

There are also doubts the election will happen at all, with lingering questions about whether Afghanistanshould hold a key poll amid a months-long, US-led push to forge a peace deal with the Taliban.

This week US Secretary of State Mike Pompeo said that President Donald Trump wants to begin withdrawing troops before the vote, though he emphasised in comments to reporters on Tuesday that there is “no deadline”.

But the push has ignited widespread concern among Afghans that in Washington’s rush to exit its longest war the Taliban will be returned to some semblance of power.