BAMAKO, Mali (AP) — As deadly attacks by extremists become more brazen in Mali, officials and citizens fear this month’s presidential election will be at risk from growing insecurity.

A branch of al-Qaida even set off a car bomb at the headquarters of a new West African counterterror force late last month, further destabilizing central Mali as extremist groups expand from remote northern regions where they have had strongholds for years.

A more assertive response by Mali’s security forces has led to accusations of extrajudicial killings, while neighbors turn on each other amid suspicions of joining extremist groups. At least 289 civilians including young children have been killed in communal violence since the beginning of the year, with some burned alive in their homes or killed while hiding in mosques, the United Nations said this month.

As the July 29 elections approach, insecurity is a major issue for candidates including President Ibrahim Boubacar Keïta, who seeks a second term. Experts warn of a humanitarian crisis as hundreds of schools have closed out of fear of attack.

“It would be difficult to organize the elections in my commune in Mondoro, near the border between Mali and Burkina Faso,” one local official, Deputy Mayor Moulaye Ongoiba, told The Associated Press. Extremist attacks in the region have risen over the past year, while tensions grow between ethnic Fulani Muslims and other groups such as the Dogon and Bambara who accuse the Fulani of being recruited by jihadists.

“The Malian army attacks the civilians thinking that they are complicit with the jihadists, and the jihadists attack the civilians thinking that they are complicit with the army. It’s a chaotic situation,” the 32-year-old deputy mayor said. “People are afraid of kamikazes, conflicts in the polling station or even a post-election crisis.”

The situation is worse than during the previous elections in 2013, Andrew Lebovich, Mali expert and visiting fellow with the European Council on Foreign Relations, told the AP.

Five years ago a French military intervention had pushed al-Qaida-linked fighters from their strongholds in the north and security appeared to be improving. But while the international community has invested millions of dollars in Mali’s government, the situation has deteriorated. French soldiers on patrol in the northeastern city of Gao were targeted just two days after the deadly attack on the G5 Sahel headquarters.

With the absence or weakness of state security in some areas, “some communities have had to make a choice to work with extremists or militias,” Lebovich said, adding that Malian forces have made it worse by “targeting (Fulani) in central Mali and by making it clear the state was unwilling to provide security.”

The government has confirmed security forces’ participation in the extrajudicial killings last month of 25 Fulani men in the central Mopti region, and the U.N. has urged authorities to prevent similar attacks.

“These major crimes threaten communal cohesion in Mali and facilitate jihadist groups’ recruitment efforts. They also undermine the role the international community plays in Mali, including its training programs for the security forces,” Lebovich wrote in a recent report. “Continuing failure to deal with these issues will only make peace harder to achieve.”

In a separate report this month, U.N. independent expert Alioune Tine said Malian authorities must investigate what he called an alarming increase in rights violations by militias “often with the participation of armed groups, resulting in deaths, injuries, destruction or burning of property and people being forced to leave their homes.”

He expressed grave concern over the “continuing deterioration” in central Mali and in the region of Menaka, near Niger, which has become a hiding place for extremists linked to the Islamic State group who clash with local self-defense forces. More than 120 people were killed there between April 26 and May 18, Tine said.

Extremists take advantage of the absence of state power, pitting communities against one another, Tine said.

Civilians unhappy with Mali’s instability may start sympathizing with the extremists or other armed groups, human rights groups have warned.

In one example in January, extremists attacked an army base in the village of Soumpi on the road between Mauritania and Timbuktu. Residents did not condemn the attack, saying they were often stopped by the military along the road and forced to pay bribes.

Extremists have expanded their messaging to address the upcoming vote. When the government in February announced the election dates, al-Qaida’s Mali branch issued warnings on social media against going to the polls.

“Our duty to all is to neutralize these unbelieving unbelievers with hands stained by the blood of the innocent and with pockets and safes filled with the money of the needy,” Abdou Abdirrahmane As-sanhaji, senior judge of a coalition of jihadist groups, said of politicians in one post.

Some residents in Mali’s north said that despite the threats they hope elections can go ahead.

“Here in Timbuktu, people are used to terrorist attacks. The campaign continues despite terrorist threats,” said Alassane Ag Idiasse, 30, who works with a private security group used by the U.N. peacekeeping mission in Mali, currently the deadliest in the world. “We only hope that everything will be fine.”