In four and a half hours of fighting about 10 UN troops and as many soldiers with France's Barkhane operation were injured, according to Mali's security ministry.
A dozen rockets were fired at the UN and French bases at to the city's airport. At the same time gunmen dressed as UN blue helmets tried to enter the compounds in two vehicles rigged with bombs, one bearing the Malian military's marking, the other the UN's.
Only one of the vehicles exploded.
"At the turn towards the airport I noticed that there was a first vehicle, a white pick-up truck with UN insignia, that had been stopped with its charge of explosives," Timbuktu journalist Yéya Tandina told RFI. "I felt there was panic in the ranks of Minusma. They were firing all over the place."
Six local residents, including a 10-year-old child, were hospitalised with bullet wounds, the local hospital said.
Sources told the AFP news agency that this is the first attack on such a scale against the UN forces in Timbuktu.
The United Nations has nearly 13,000 troops and police in Mali, many of them deployed in the north of the country where French forces have been operating since an Islamist and Tuareg separatist revolt in 2013.
Some 1,500 African, American and European troops have been training in the west and north of neighbouring Niger.
They will reinforce the G5 Sahel force of African nations fighting armed Islamists in the region.