Gul Agha Jalali used to spend his nights planting bombs -- hoping to target an Afghan government soldier or, better still, a foreign serviceman.
These days, the 23-year-old Taliban member is studying English and has enrolled in a computer science course in the capital, Kabul.
"When our country was occupied by infidels, we needed bombs, mortars and guns," says Jalali, an employee at the Ministry of Transport and Civil Aviation.
Now there is a greater need for education, he told AFP.
Since the Taliban swept back to power in August last year, hundreds of fighters have returned to school -- either on their own or pushed by their commanders.
The word "Taliban" actually means "students" in Arabic, and the hardline Islamist movement's name stems from the religious schools in southern Afghanistan it emerged from in the 1990s.
Most Taliban fighters were educated in these madrassas, where studies are largely limited to the Koran and other Islamic themes.
Many conservative Afghan clerics -- particularly among the Taliban -- are sceptical of more modern education, apart from subjects than can be applied practically, such as engineering or medicine.
"The world is evolving, we need technology and development," said Jalali, who planted bombs for five years but is now among a dozen Taliban studying computers at the transport ministry.
The desire of fighters like Jalali to go back to school showed Afghans yearned for education, government spokesman Bilal Karimi said.
"Many motivated mujahideen who had not completed their studies reached out to educational institutions and are now studying their favorite courses," he told AFP.
But education is a hugely problematic issue in the country, with secondary school girls barred from classes since the Taliban returned to power -- and no sign of them being allowed back despite promises from some in the leadership.
While the earlier curriculum largely remains the same, studies on music and sculpture have been scrapped at schools and universities, which are suffering a paucity of teachers and lecturers following an exodus of Afghanistan's educated elite.
But some Taliban students, like Jalali, have big plans.
Kabul's Muslim Institute has a student body of around 3,000 -- half of them women -- and includes some 300 Taliban fighters, many distinctive with their bushy beards and turbans.
On a recent tour, AFP saw one Taliban fighter retrieve a pistol from a locker room at the end of his lessons -- an incongruous sight in a pastel-colored room adorned with posters of smiling co-ed students.
"When they arrive, they hand over their weapons. They don't use force or take advantage of their position," said an institute official who asked not to be named.
Desire to study
Amanullah Mubariz was 18 when he joined the Taliban but never gave up his desire to study.
"I applied to a university in India, but I failed my English test," said Mubariz, now 25, declining to reveal his current position in the Taliban.
"That's why I enrolled here," he said, referring to the Muslim Institute.
Mohammad Sabir, in contrast, is happy to admit he works for the Taliban's intelligence agency despite also being a student at the private Dawat University.
"I resumed my studies this year after the victory of the Islamic Emirate," he says, his long hair and eyes lined with traditional kohl eyeliner peeking out from beneath a white turban.
Like Jalali, he paused his education to join the Taliban and also planted bombs and carried out ambushes with his brother in Wardak province.
All the Taliban students AFP spoke to said they wanted to use their education to help develop the country, so how do they feel about girls being deprived of that opportunity?
"Personally, as a young man, a student and a member of the Emirate, I think that they have the right to education," said Mubariz.
"They can serve our country the way we are doing."
"This country needs them as much as it needs us," added Jalali.