The home page for Terrasse-Vaudreuil, a municipality of about 2,000 residents just west of Montreal, was hacked Thursday evening by a group calling itself MECA, the Middle East Cyber Army.
The web page displayed a message praising Islam and made reference to the Charlie Hebdo attacks in Paris earlier this month.
Experts said there have been hundreds of cyberattacks in recent days, targeting sites that have vulnerable security.
"I know across the world there are many thousands of sites that had been infiltrated by this sort of thing and I guess today was our day, and hopefully it won't be again," said Ron Kelley, Terrasse-Vaudreuil's director-general.
City officials met with Quebec provincial police, who have opened an investigation after receiving information the hacking.
"From what we've learned, it has nothing to do with Terrasse-Vaudreuil," Mayor Michel Bourdeau said. "It's a combination of circumstances."
Bourdeau said he was alerted to the hack Thursday evening and the page was restored early Friday.
Bourdeau added that hackers only penetrated the city's home page and that residents' personal information — stored on a separate server — was not accessed.
"Residents have nothing to worry about concerning their information," he said.
In bright blue letters against a background of a burgundy and gold Qur'an, the Islamic holy book, the hackers' message read: "We are Muslims. Quran is our book. In Allah (God) we trust. For Allah we work. Screw you Charlie Hebdo."
The message ended with the hashtag #OPFRANCE, which has been used by cyber hackers following the deadly attacks at satirical magazine Charlie Hebdo in Paris.
Earlier this month, French authorities reported more than 19,000 French websites had faced cyber attacks. MECA is among the groups believed to be behind the hacks, French officials said.
This week, Paris Match magazine published an interview with a 19-year-old hacker claiming to belong to MECA. The group's core, he said, consisted of 10 teenagers.
In recent days, MECA has defaced more than 1,000 websites from around the world with the same message, explained Helmi Noman, senior researcher at Citizen Lab in Toronto, which monitors cyber activities and global security.
"The vast majority of the defaced websites have nothing to do with Charlie Hebdo or even France," Noman said in an e-mail interview. "The hackers are basically attaching political messages to websites that have security vulnerabilities."
An online campaign to recruit hackers to deface the Charlie Hebdo website is ongoing, he added.
But the hacking still had Terrasse-Vaudreuil residents perplexed, a local journalist said.
Carmen Fabio, editor-in-chief at community newspaper Your Local Journal, said locals' response to the hacking was one of incredulity.
"I don't think anyone really perceived it as a threat. But the biggest question was, of all places, why here?" Fabio said.
Also on HuffPost