TORONTO -- A car and knife attack on a police officer outside a football game and a high-speed chase of a moving van that left four people injured was the work of a Somali refugee who was likely working alone and was known to police for extremist ideology, Canadian authorities said Sunday.

Marlin Degrand, assistant commissioner of the Royal Canadian Mounted Police, said officers took a 30-year-old man into custody in the Western Canadian city of Edmonton, Alberta.

Police declined to identify the man because he had not yet been charged, saying the pending charges included terrorism and five counts of attempted murder.

Get Breaking News Delivered to Your Inbox

A Canadian government official identified the suspect as Abdulahi Hasan Sharif. The official agreed to reveal the name only if not quoted by name because he was not authorized to speak publicly ahead of the police announcement.

Edmonton Police Chief Rod Knecht said an Islamic State of Iraq and Syria (ISIS) flag was found in the car that hit the officer, and Canadian Prime Minister Justin Trudeau called it a terror attack.

Muslim women speak to a police woman during a rally, organised by the Alberta Muslim Public Affairs Council (AMPAC) in solidarity with the Edmonton Police Service, following an attack in Edmonton, Canada, Oct. 1, 2017. REUTERS

The suspect was known to both Edmonton police and the Royal Canadian Mounted Police. Degrand said he was flagged in 2015 for extremist ideologies and police interviewed him at the time, but he said charges were not warranted after an "exhaustive investigation."

Degrand said the suspect is a refugee from Somalia who had applied for refugee status.

"To the best of our knowledge, this was a lone wolf attack," Edmonton Mayor Don Iveson said.

The incident took place outside a Canadian Football League game at Edmonton's Commonwealth Stadium on Saturday night.

Police released graphic video showing a white Chevrolet Malibu ramming into a police officer standing in front of his cruiser. The officer flies into the air and the Malibu then crashes into the police car.

The driver gets out and appears to stab the officer, who wrestles the suspect to the ground and then rises as the suspect flees on foot.

"Seeing the video is very upsetting because of the level of violence and level of intent," Iveson said.

The Edmonton police chief said Constable Mike Chernyk, a 48-year-old who has been an officer 11 years, was released from the hospital overnight with stab wounds on face and head and abrasions on his arms.

"He was in a struggle for his life, holding on to his gun with one hand and blocking the knife with the other," Knecht said.

A few hours later, a U-Haul van was stopped at an impaired driving checkpoint north of downtown, on Wayne Gretzky Drive. Knecht said the name of the driver was similar to the name of the registered owner of the car that hit the officer.

He said the van then sped off toward downtown with police in pursuit. Police said the vehicle swerved at pedestrians at crosswalks throughout the chase.

Four people were hurt. Two had been released from the hospital and one was upgraded from critical to stable condition. Their injuries ranged from broken limbs to brain bleeding.

The van eventually flipped near a downtown hotel and the suspect was arrested after a Taser was employed. No shots were fired by police or the suspect.

Witness Pat Hannigan told reporters he saw police pull a man from the windshield of the toppled van and estimated that 30 police cars had been chasing it.

Austin Elgie, manager of The Pint bar just west of the downtown core, also saw the van zoom by with police giving chase.

It "peeled" into an alley where people were smoking, he said.

"It was crazy," Elgie said. "It just came around the corner, ripping. I thought at first he was pulling over for the cops coming by, but he was clearly the one they were chasing."

Elgie said the van hit a man who was a bar customer.

"I have a registered nurse on my bar team, and I grabbed her and had her look after the guy until the ambulance came," he said. "He was breathing and we got him in the ambulance and he was still breathing."

It was military appreciation night at the football game between the Edmonton Eskimos and the Winnipeg Blue Bombers.

Trudeau said in a statement that Canadians "stand with the people of Edmonton after the terrorist attack on Saturday that sent an Edmonton Police Service officer to hospital and injured a number of innocent people who were out to cheer on their football team and to enjoy an evening in their city."

The White House condemned the attack and said U.S. law enforcement was in touch with Canadian authorities to offer assistance.