A suspect was apprehended by police after surrendering
The shooting happened at the Siam Paragon, one of the city's most famous shopping centres.
The victims were from China and Myanmar, Thailand's police chief said.
The suspect, whose motives are unclear - surrendered to officers and had been using a handgun, police said.
Five other people - one Lao national, one Chinese and three Thais - were injured.
One of the victims was Chinese and the other, who worked at the mall, was Burmese, national police chief Torsak Sukvimol told a news conference.
Footage showed shoppers inside the Siam Paragon mall running for the exits after they heard multiple shots being fired.
By the time police arrived on the scene at 17:10 local time (10:10 GMT) and were able to disarm the assailant, several people had been hit.
Ambulances had to battle with the notoriously busy rush hour traffic in this part of Bangkok to carry the victims to hospital.
The teenaged suspect has been transferred to Pathumwan police station.
He attended a school close to the mall and had a record of getting treatment for a mental health condition at Rajvithi hospital, but had recently stopped taking his medication, Mr Sukvimol said.
The headteacher of the private school, named The Essence, wrote to parents confirming the suspect was a pupil and said the school would cooperate with police.
Eyewitnesses inside the mall said they hid inside shops and bathrooms.
Jakkraphan Nakharisi, 29, an ice cream seller who has worked at the mall for two years, told the BBC that he did not realise at first that the noises were gunshots.
"There were four to five of them. And then silence. Then there were probably another two shots. Then I heard someone in my shop shout, 'There's some shooting!'
"I ducked behind the ice cream tank immediately. I didn't know where to run. I thought I couldn't just go out recklessly."
He said he heard security guards escort people off the premises, before he left "no more than 10 minutes after the shooting".
Palmyra Kownack, a 61-year old UK resident currently in Bangkok who was at the Paragon when the shooting took place, told the BBC she had been left shaken.
"There was a lot of shouting and shots," she said. "It was difficult to know what was happening. We didn't know if it was one person or a gang."
"We could see military walking by. We stayed there for about an hour until we finally got the all clear to leave. We were escorted out by the back exit. It was chaos with so many people."
In a statement, a Siam Paragon spokesperson expressed condolences to the victims.
"As soon as the incident occurred, the police and Siam Paragon's security team immediately evacuated customers and employees from the building, prioritising the safety of all customers, employees, and tenants," the statement said.
Mass shootings in Thailand are rare, although gun ownership rates are relatively high for the region.
An ex-policeman killed at least 37 people, most of them children, in a gun and knife attack at a childcare centre in in Nong Bua Lamphu province in north-east Thailand in October last year.
In 2020, a soldier killed 29 people and injured dozens more in the city of Nakhon Ratchasima.
-- Courtesy of BBC News