BAMAKO (Reuters) - Clashes broke out in Mali’s northern city of Timbuktu on Thursday between the Arab, Tuareg and black communities, days before elections seen as a test of the country’s security situation, the local governor said.

President Ibrahim Boubacar Keita will seek a second term in office on Sunday amid rising discontent over the government’s record on security, especially in the desert center and north where Islamist groups operate.

Armed protesters from Mali’s Arab community burned tyres and torched vehicles in Timbuktu on Wednesday, protesting against worsening insecurity and alleged ill treatment by security forces.

Residents said the trigger for Wednesday’s violence was a robbery of a pharmacy owned by a black trader. Malian troops responded by arresting some armed Arab youths, sparking a gun battle in which no one was hurt.

On Thursday, about 100 people took to the streets and clashes ensued between the city’s light-skinned Arab and Tuaregs and the black community. The violence died down by the afternoon, the governor, General Ould Maudou, told Reuters. No one was injured, he said.

“The situation in Timbuktu is calming down,” he said. “There were clashes between whites and blacks. The situation is being handled.”

Timbuktu’s Arab and Tuareg communities have long complained of being persecuted by Malian soldiers, made up mostly of ethnic groups from the south and center.

Violence continues to rock Mali, especially the north, five years after French forces beat back a separatist and Islamist insurgency in 2013.

President Keita is facing former finance minister Soumaila Cisse and two dozen other candidates in Sunday’s election.

While militants have not specifically threatened the running of the vote, the unrest threatens to seriously dent turnout in polls that some observers hoped would chart a way out of years of political and ethnic unrest.