The two victims and the attacker were all wounded in the attack, which had triggered a major response by emergency services fearing a larger incident, and one of the victims was in a critical condition, police said.

"The initial victim was a woman married to the attacker," a police spokesperson told reporters. "There is no longer danger to other people."

Officials initially said at least four people were injured in what had first appeared to be a random, ongoing attack.

"This is a family from Syria where the perpetrator is married to one of the victims," police said in a separate statement.

The suspect was first apprehended by civilians witnessing the attack, including students from a nearby high school, officials said.

The attack took place in the rural, mountainous Nore and Uvdal municipality in Norway's Numedal region.

(Reporting by Victoria Klesty, writing by Terje Solsvik, editing by Gwladys Fouche, William Maclean and Nick Macfie)