BAMAKO (Reuters) - Malian masons have rebuilt eight mausoleums destroyed by Islamist militants that took over the desert city of Timbuktu in 2012, the United Nations and Malian officials said.

Invading Islamist fighters considered a local Sufi veneration for the tombs as idolatrous and hacked them to pieces. Thousands of ancient manuscripts were also burned in a suicide bombing.

Following an appeal from the West African country's government, UNESCO said it hired local craftsmen to rebuild the mausoleums.

"Your work is a lesson in tolerance, dialogue and peace," UNESCO Director General Irina Bokova told them during a visit to the world heritage site on Saturday alongside the Malian government and local leaders.

She added that those responsible for the destruction would be brought before the International Criminal Court, according to Radio France International.

A U.N. peacekeeping mission in the country (MINUSMA) which is supporting the project said that eight of 14 tombs had been rebuilt and that work on the others was nearly completed. France Norway, Switzerland and the European Union have also contributed either technical or financial assistance to the project.

Much of Timbuktu's rich cultural heritage dates back to the 13th-17th centuries when the city, a key transit point for caravans crossing the Sahara, became a global center of Islamic learning. Some locals ascribe special protective powers to the tombs housing Sufi saints.

The city remains an important pilgrimage site for Muslims in West Africa.

"This reconstruction is about much more than walls," said Malian culture minister Ramatoulaye N'Diaye Diallo. "It's about morally rearming the Timbuktu communities and the Malian people."

Islamist militants were scattered by a French military intervention in 2013. But they continue to attack Western and Malian targets in the area, preventing most tourists from returning.

Al Qaeda offshoot the Islamic State also opposes the mystical school of Islam known as Sufism and has destroyed its shrines and tombs in eastern Syria.