A man walks past the shell of a burnt car in Gonaives, Haiti in this file picture. With a general election on the horizon, a mass shooting has horrified the country.

Port-au-Prince, Haiti - Gang members attacked displaced people huddling inside a church near Haiti's capital, killing around 40, some of them execution-style, the mayor told AFP.

"We have counted around 40 bodies. Searches are continuing. Some people are still missing" after the attack Sunday night in the town of Kenscoff in the hills above the capital, mayor Massillon Jean said.

He described "a night of terror" in a town plagued for months by gang violence.

Jean said that among other places the assailants targeted a site housing people who had already fled violence.