There was no immediate claim of responsibility for the blast, 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.
Khost provincial governor spokesman Talib Mangal told AFP at least 22 people were wounded in the explosion in the eastern province bordering Pakistan.
A spokesman for the First Brigade of the 203 Army Corps, where the mosque was located, said initial information showed "more than 10" soldiers had been killed and 15 wounded.
Some of the wounded had been transported to a hospital in the provincial capital Khost while four military helicopters also had been dispatched to bring others to Kabul, Defence ministry spokesman Ghafoor Ahmad Jawed told AFP.
It is not clear how many worshippers were inside the mosque at the time of the explosion or the nature of the blast.
"I was entering the mosque when the blast happened," said Abdullah, who like many Afghans uses only one name.
Week of violence
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 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 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 Ashraf 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.