Incidents took place in the city of Kongsberg, 82 km (51 miles) southwest of the capital, Oslo.
A suspect has been apprehended by the police, who believe they have acted alone.
There was a confrontation with the police and the man tried to escape before he was arrested, the police chief said.
Two other people were injured and are in intensive care, including an officer who was off duty and inside the store where the attack took place, police said.
The attacks are linked to a Coop Extra supermarket in the city center and Coop spokesperson Harald Kristiansen said: “We can confirm that there has been a serious incident in our store and that none of our employees are not physically injured.
“We are now concerned with monitoring our employees, and beyond that, we refer to the police investigation. “
Police were called to the scene of the incident in central Kongsberg at 6:30 p.m. Wednesday evening with additional resources sent from other cities, including Oslo.
Police chief Oyvind Aas told a press conference on Wednesday evening: “I can, unfortunately, confirm that several people were killed and injured.
“A man was arrested at 6:47 pm. According to the information we have at the moment, one person committed this act alone. He has not yet been interviewed, so it is too early to say what the motive was.
“There is significant police activity in the area because there are many crime scenes. “
He declined to comment on the death toll and said he could not say whether the man was known to police.
The man has now been taken to Drammen police station.
Officer Aas added: “It is natural to wonder if this is an act of terrorism. He has not been questioned and it is too early to draw a conclusion.
When asked if he could confirm that a police officer was shot in the back, he replied, “I cannot answer that question.”
The attacks took place in a “large area” of Kongsberg, a municipality of about 28,000 inhabitants in south-eastern Norway, police said.
“There is still a lot of police activity in the area. This is because the aggressor has moved over a large area, and we are now working, among other things, to get clues and gather as much information as possible about what happened, ”the officer said. Aas.
The injured have been taken to hospital and the Kongsberg Council Crisis Team is helping those in need.
Oslo Police spokesperson Unni Grondal said: “We are helping with national assistance resources such as police helicopters, bomb squads and emergency response troop crews. . “
Norwegian Minister of Justice and Public Safety Monica Maeland has been briefed and is monitoring the situation closely.
Local media reported that a large area on the west side of the city had been cordoned off and investigations were underway.
British Ambassador to Norway Richard Wood wrote on Twitter: “Police confirm five people were killed in #Kongsberg and several injured, including a policeman. A shocking incident. Sincere condolences to those affected. “
The Norwegian police – who normally do not carry weapons – have decided to arm themselves temporarily.
Norwegian police leadership said: “This is an additional emergency measure. Police do not yet have concrete indications that there is a change in the level of threat in the country. “
Acting Prime Minister Erna Solberg called the attack “macabre” and said it was too early to speculate on the man’s motive.
She added: “The perpetrator has committed horrific acts against several people. The incident shocked us.