A suicide bomber blew himself up inside a packed mosque on an Afghan army base during Friday prayers, killing at least nine soldiers, officials said, in the latest bloody violence to rock the war-torn country.
At least 22 were wounded in the blast in the eastern province of Khost, which follows a wave of deadly attacks across Afghanistan in recent weeks as militants step up assaults amid a flurry of diplomatic efforts to end the 17-year conflict.
There was no immediate claim of responsibility for the attack, but the Islamic State group has previously claimed most suicide explosions targeting mosques.
A spokesman for the First Brigade of the 203 Army Corps in Ismail Khel Mandozai district, where the mosque was located, said nine soldiers had been killed and 22 wounded.
But a government official told AFP on the condition of anonymity that the death toll was 27 with 44 injured.
The attacker detonated his explosives after prayers started, but "we don't know how he got inside the mosque", provincial governor Hukum Khan Habibi said.
Provincial public health director Gul Ahmad Shah confirmed 44 wounded had been taken to the Khost city public hospital.
But at least two private medical facilities said they had received a total of 35 wounded, suggesting the casualty toll could be much higher.
Four military helicopters also had been dispatched to bring some of the wounded to Kabul, defence ministry spokesman Ghafoor Ahmad Jawed told AFP. He could not provide a casualty figure.
President Ashraf Ghani condemned the attack as "un-Islamic" and "inhumane", and ordered an investigation.
A soldier who was injured in the blast said hundreds of worshippers were inside the mosque at the time of the attack.
"When the explosion happened my leg and hand started bleeding," Mufti, who like many Afghans uses only one name, told AFP from his hospital bed in Khost city.
"I don't know how I got to the hospital."
It has been a bloody week for Afghanistan after at least 55 people were killed and 94 wounded when a suicide bomber blew himself up in the middle of a religious gathering in Kabul.
No militant group has claimed the explosion on Tuesday evening at the Uranus Wedding Palace, where hundreds of religious scholars had been marking the Prophet Mohammad's birthday.
The attack drew widespread condemnation in Afghanistan and abroad, with the United Nations describing it as an "atrocity".
Friday's explosion in Khost comes as Afghan security forces suffer record casualties, which experts warn have reached unsustainable levels as the Taliban maintain the upper hand in the war.
Since the start of 2015, when local forces took over from US-led Nato combat troops to secure the country, nearly 30,000 Afghan soldiers and police have been killed, President Ghani revealed this month -- a figure far higher than anything previously acknowledged.
That is an average of around 20 soldiers killed per day.
Casualty figures for Afghan forces have been kept under wraps since 2017 at the request of Kabul, but Nato's Resolute Support mission in Afghanistan recently told a US watchdog that this summer's toll was worse than ever.
US envoy Zalmay Khalilzad expressed hopes in Kabul last Sunday that a peace deal to end the war could be struck before the Afghan presidential election, scheduled for April 20.
His comments underscore an apparent increasing sense of urgency in the White House and among American diplomats for a peace deal to be done quickly.