The Canadian police arrested a refugee from Somalia on suspicion of terrorist acts early Sunday after a police officer in Edmonton was struck with a car and stabbed outside a football game. Four other people were later deliberately hit by a U-Haul truck driven by the same suspect, the authorities said.

Prime Minister Justin Trudeau of Canada called the assaults a terrorist attack.

Marlin Degrand, a division superintendent for the Royal Canadian Mounted Police, said at a news conference in Edmonton that the suspect, who is 30, had been the subject of an inquiry two years ago after he displayed signs of extremism but that there had been “insufficient evidence” to make an arrest. Mr. Degrand said the man had been deemed “not a threat.”

The police did not identify the suspect beyond saying he was Somali. CBC News, quoting unidentified sources, said his name was Abdulahi Hasan Sharif.

Rod Knecht, chief of the Edmonton Police Service, said that officers had found an Islamic State flag in the car that hit the police officer. “Currently, we believe this is an individual who acted alone,” Chief Knecht said in a statement released on Sunday morning.