Ahmad Al-Faqi Al-Mahdi, whose war crime trial in The Hague opens on Monday, is a quiet Koranic scholar turned ruthless enforcer for jihadists when they occupied the fabled Malian city of Timbuktu.

Born around 40 years ago in Agoune, 100 kilometres (60 miles) from Timbuktu, the curly-haired former teacher was steeped in Islamic learning from a young age.

He fast became a fervent proponent of the strictest interpretations of Islamic law, which had little popular support in Mali, but his chance came when jihadists descended on Timbuktu in April 2012.

Mahdi was soon recruited by the Islamist group Ansar Dine as "the most competent and prominent person in Timbuktu when it came to being knowledgeable in religious matters", in the words of International Criminal Court (ICC) prosecutors.

Among a group of outsiders, Mahdi stood out for his local knowledge while also being a fluent Arabic speaker, and his scholarly background lent a veneer of credence to the Islamists' call to destroy several UNESCO-listed sites they considered idolatrous.

Mahdi has made clear "his wish to plead guilty" to orchestrating the destruction of nine mausoleums and a section of the revered Sidi Yahia mosque, which date back to the 15th and 16th centuries.

- Phenomenal memory -

The war crime charge he faces relates to their destruction.

His former teachers recall a quiet, even introverted boy who impressed with the much-prized feat of memorising the entire Koran, Islam's holy book.

"Among the 82 students in the madrassa (Islamic school), Ahmad had the most phenomenal memory, by a long way," said El Hadj Mohamed Coulibaly, his teacher in the 1980s.

"He had the whole Koran in his head. We couldn't catch him out," Coulibaly said.

A brilliant pupil, he spent time in Libya and Saudi Arabia, then went on to a Koranic college and worked as an Islamic teacher elsewhere in Mali before returning to the Timbuktu area shortly before jihadists entered the city.

Waves of unrest had led to a military coup in March that year and an all-out rebellion in the country's north, led by Tuareg groups who were soon sidelined by Al-Qaeda-linked Islamists, including the Ansar Dine group.

When the jihadists swaggered into town, Mahdi was working at an association for Muslim youths, providing them with religious advice, and was well known for his rigid principles and advocacy of sharia law.

He already had connections in the jihadist world, rubbing shoulders with the man who would become spokesman for Ansar Dine in Timbuktu, Sanda Ould Bouamama, and through his marriage to the niece of Houka Houka Ag Alfousseyni, an Islamic judge.

Life in Timbuktu altered quickly to fit the vision Mahdi had always wanted for his nation: adulterers were stoned, thieves had their arms amputated, and smokers and drinkers were whipped.

In a city known also for its long musical tradition, singing and concerts were banned.

Mahdi became the head of the "Hisbah", or morality police, which upheld the jihadists' narrow interpretation of the Koran's teachings.

As the head of this brigade, "he used the carrot and the stick", said a senior religious figure in Timbuktu, who asked not to be named for fear of retribution, personally whipping women he judged "impure", but holding sympathetic meetings with smokers reconsidering their habit.

- Shocked humanity's consciousness -

Mahdi was "a bit town sheriff" in his style, also presenting himself as the boss of all the city's imams, a local official told AFP.

By late June in 2012, Mahdi had grown frustrated by the townspeople's unwillingness to desist from their long-held practice of worshipping Timbuktu's shrines of Muslim saints.

Using pickaxes, chisels and pick-up trucks, his men destroyed 14 shrines and a section of the mosque, wiping out centuries of tradition that attracted pilgrims from across Africa and the Middle East.

"The prophet (Mohamed) said break apart these mausoleums because all people are equal and so in a cemetery no tomb must rise higher than another," he told an AFP journalist, shortly before the destruction began.

Mahdi's role was to "justify all decisions made in the name of sharia, the name of the Koran," he added.

But Ansar Dine's actions, led by Mahdi, shocked "humanity's collective consciousness", said prosecutor Fatou Bensouda at the Hague in March, leading to an unusual type of war crime charge.

His ICC trial is a collection of firsts: the first to be brought by the world's only permanent war crimes court over the extremist violence in Mali, the first jihadist to face justice before the court, and the first time an ICC defendant has said he will plead guilty.

His lawyer Jean-Louis Gilissen defended him as "an intelligent, reasonable and educated man" who had sought to do good in response to a "divine message".

But though the tombs have been rebuilt, the city once known as the "Pearl of the Desert" has yet to regain its shine, riven with insecurity and violence under the watch of Islamist and criminal gangs.