France's president has said it would be wrong to assume the conflict in Mali is over, three weeks after launching an offensive to oust Islamist rebels.
Francois Hollande was speaking during a visit to the recently recaptured city of Timbuktu, where thousands welcomed him with chants of "Vive la France".
Mr Hollande said French forces would help Malian forces finish the job of re-establishing control in the north.
Meanwhile, the UN said Tuareg and Arabs in the north were at risk of reprisals.
The UN special adviser on the prevention of genocide said there had been serious allegations of human rights violations committed by the Malian army, including summary executions and disappearances.
There had also been reports of incidents of mob lynching and looting of properties belonging to Arab and Tuareg communities, which had been accused of supporting armed Islamist groups, Adama Dieng added.
The allegations came as heavily-armoured columns of French and Malian troops continued their advance in northern Mali.
They are attempting to secure the north-eastern city of Kidal, the militants' last stronghold, having captured the airport on Wednesday.
Mr Hollande flew into the central town of Sevare on Saturday with his ministers of defence, foreign affairs and development. Mali's interim President, Dioncounda Traore, met them at the airport.
They then flew to Timbuktu's airport before being driven to the 700-year-old mud mosque of Djingareyber and the Ahmed Baba Institute, where fleeing militants set fire to about 2,000 priceless manuscripts.
Mr Hollande said French troops would stay in Mali for "as long as needed. Until the handover is completed".
Speaking beside the French president during the rapturous Timbuktu reception, Mali's interim President Diouncounda Traore said: "It shows how much France is determined to go all the way side by side with Mali. We ask France to continue with us."
Crowds waved French flags and shouted "Vive la France! Vive Francois Hollande!" as the French leader passed them.
"If I could have one wish, it would be that the French army stays in the Sahara, that they create a base here," Moustapha Ben Essayati, a resident, told the Associated Press news agency.
Many women wore vibrantly coloured clothes and jewellery, which correspondents say was something they could not do during the past year of Islamist rule.
"The women of Timbuktu will thank Francois Hollande forever," 53-year-old Fanta Diarra Toure, one of thousands of people who gathered in the city's main square, told the AFP news agency.
"We must tell him that he has cut down the tree but still has to tear up its roots," she added, referring to the Islamist militants.
Addressing French troops at Timbuktu's airport afterwards, President Hollande warned them that that the mission was still dangerous.
"The conflict is not over. It would be a mistake to think that because, with our Malian friends, we have managed to restore order in towns like Gao and Timbuktu that we can stop there," he said.
"The Malian authorities want to restore the territorial integrity that was - for a time - snatched away from them. We will be at their side."
Before he left for Mali, Mr Hollande said he wanted to ensure African troops were deployed to replace the French force as soon as possible, and that he wanted Mali's transitional government to begin a political dialogue with opposition groups in the north.
About 800 French soldiers, including hundreds of paratroopers, took part in the operation which saw Timbuktu recaptured six days ago. A total of 3,500 French troops are currently in Mali.
Nearly 2,000 army personnel from Chad and Niger, with experience of fighting in the Sahara desert, are already helping consolidate the recent gains. A further 6,000 troops will be deployed as part of the UN-backed African-led International Support Mission to Mali (Afisma).
The BBC's Andrew Harding in Timbuktu says this was a big moment for President Hollande, but there is a danger that this is as good as it may get for him.
Now, things get more complicated, our correspondent adds, and if the French get their exit strategy wrong and move too quickly, Mali could easily be plunged back into chaos.