TORONTO — A man wearing a police uniform went on a shooting rampage as he drove around the Canadian province of Nova Scotia on Sunday, killing 13 people, including a police officer. Officials said the suspected shooter was also dead.

Several of the dead were found inside and outside one home in the small, rural town of Portapique, about 60 miles (100 kilometers) north of Halifax late Saturday. Police began advising residents of the town — already on lockdown because of the coronavirus pandemic — to lock their doors and stay in their basements. Several homes in the area were set on fire as well.

Police identified the man believed to be the shooter as Gabriel Wortman, 51, who was thought to live part-time in Portapique. Authorities said he disguised himself as a police officer in uniform at one point and made his car look like a Royal Canadian Mounted Police cruiser.

Wortman was arrested by the RCMP at a gas station in Enfield, just outside Halifax. Police later announced that he had died.

“This is one of the most senseless acts of violence in our province’s history,” said Nova Scotia Premier Stephen McNeil. He said it was an additional “heavy burden” amid efforts to contain the new coronavirus.

RCMP spokesman Daniel Brien confirmed that 13 people had been killed as had the shooter. He said he could not rule out that the death toll could still rise. Already, that makes it one of the worst shootings in Canadian history.

Mass shootings are relatively rare in Canada. The country overhauled its gun-control laws after the country’s worst mass shooting in 1989, when gunman Marc Lepine killed 14 women and himself at Montreal’s Ecole Polytechnique college. It is now illegal to possess an unregistered handgun or any kind of rapid-fire weapon. Canada also requires training, a personal risk assessment, two references, spousal notification and criminal record checks to purchase a weapon.

“We believe it to be one person who is responsible for all the killings and that he alone moved across the northern part of the province and committed what appears to be several homicides,” RCMP Chief Superintendent Chris Leather said.

Police have not provided a motive for the attack, but Leather said many of the victims did not know the shooter.

“That fact that this individual had a uniform and a police car at his disposal certainly speaks to it not being a random act,” Leather said.

Leather said they would investigate whether the attack had anything to do with the coronavirus pandemic but no link has been found thus far.

The dead officer was identified as Constable Heidi Stevenson, a mother of two and a 23-year veteran of the force. Another officer was also injured.

Leather said at point there was an exchange of gunfire between the suspect and police. There were half a dozen police vehicles at the scene of a gas station where the suspect was shot. Yellow police tape surrounded the gas pumps, and a large silver-colored SUV was being investigated.

Police said earlier Sunday the suspect was driving a car that looked like a police vehicle and was wearing a police uniform, but later said he was “believed to be driving a small, silver Chevrolet SUV.” They said he is not an RCMP employee or officer.

Cpl. Lisa Croteau, a spokeswoman with the provincial force, said police received a call about “a person with firearms” at around 10:30 p.m. Saturday and the investigation “evolved into an active shooting investigation.”

“My heart goes out to everyone affected in what is a terrible situation,” Prime Minister Justin Trudeau said.

Christine Mills, a resident of the area, said it had been a frightening night for the small town, with armed officers patrolling the streets. In the morning, helicopters flew overhead searching for the suspect. “It’s nerve-wracking because you don’t know if somebody has lost their mind and is going to beat in your front door,” she said.

Tom Taggart, a lawmaker who represents the Portapique area in the Municipality of Colchester, said the quiet community has been shaken.

“This is just an absolutely wonderful, peaceful quiet community and the idea that this could happen in our community is unbelievable,” Taggart said by phone from his home in nearby Bass River.

A Gabriel Wortman is listed as a denturist — a person who makes dentures — in the city of Dartmouth, near Halifax, according to the Denturist Society of Nova Scotia website. A suspect photo issued by the RCMP appears to be of the same person seen in video footage being interviewed about dentures by CTV Atlantic in 2014.

Mills also said that Wortman was known locally as someone who divided his time between a residence in Halifax and a residence in Portapique.

Taggart said he didn’t know Wortman well, but spoke to him a few times when he telephoned about municipal issues.

Taggart described knowing Wortman’s “lovely big home” on Portapique Beach Road.