The incident came as the city was gearing up for an annual Pride parade.
The shooting happened outside a bar in the downtown area of the Norwegian capital, police said.
A suspect was arrested and police don’t believe any other people were involved, police spokesman Tore Barstad said.
Barstad said the motive was not immediately known and that it wasn’t clear whether the shooting had any connection to the Pride parade that was to be held Saturday in Oslo.
“Police are in contact with the organisers of the Pride event this Saturday,” Barstad told reporters.
“There will be a continuous assessment of what measures police should take to protect that event and whether this incident has a connection to Pride at all.”
He said 14 people were receiving medical treatment, eight of whom have been hospitalised.
Olav Roenneberg, a journalist from Norwegian public broadcaster NRK, said he witnessed the shooting.
“I saw a man arrive at the site with a bag. He picked up a weapon and started shooting,” Roenneberg told NRK.
“First I thought it was an air gun. Then the glass of the bar next door was shattered and I understood I had to run for cover.”
Norwegian broadcaster TV2 showed footage of people running down Oslo streets in panic as shots rang out in the background.
Oslo Pride organisers said they were in close contact with the police.
“We are shocked and saddened by the tragic incident, and we are following it closely,” Oslo Pride said in a Facebook statement.
“Our thoughts are with the victims and their loved ones.”
In 2019, another right-wing extremist killed his stepsister and then opened fire in a mosque but was overpowered before anyone there was injured.