The shooting took place early on Saturday in the downtown area of Oslo, the police said, and is being investigated as a possible act of terrorism.
The shooter reportedly opened fire right outside a popular gay bar called The London Pub and it extended to a neighbouring club and nearby streets.
“Two people are confirmed dead,” the Oslo police department said in a tweet. Some 14 people were taken to hospital, several with severe injuries, police said.
A 42-year-old male suspect believed to be the sole perpetrator was apprehended, police told reporters.
The identity of the suspect was not revealed, but in a press conference the Norwegian police said the suspected shooter was a Norwegian citizen of Iranian origin who was previously known to police but not for major crimes.
They said they had seized two firearms in connection with the attack: a handgun and an automatic weapon.
The suspect has been charged with murder, attempted murder and terrorism. Police lawyer Christian Hatlo said the charges were based on the number of people targeted at multiple locations.
“Our overall assessment is that there are grounds to believe that he wanted to cause grave fear in the population,” Mr Hatlo said.
Mr Hatlo said the suspect’s mental health was also being investigated.
“We need to go through his medical history, if he has any. It’s not something that we’re aware of now,” he said.
Photographs published by newspaper VG, broadcaster NRK and others showed a large gathering of emergency responders outside the London Pub, including police and ambulance workers.
Helicopters hovered above central Oslo while ambulance and police car sirens were heard across the city.
“I saw a man arrive with a bag, he picked up a gun and started to shoot,” journalist Olav Roenneberg of public broadcaster NRK reported.
The London pub is situated at the centre of Oslo and is one of the most popular pubs in the city.
Oslo was set to hold its annual Pride parade later on Saturday. However, after the shooting incident, the organisers have decided to call off the march.
The timing of the attack is raising alarms that it could have been intended to target the LGBT+ community ahead of the parade which was supposed to be marking 50 years of homosexuality being decriminalised in Norway.
Norway rarely witnesses mass shooting incidents, however, citizens are allowed to possess firearms with appropriate legal guidelines. Gay couples have had the right to marry and have children in the country since 2009.
Additional reporting by agencies