Twenty people were in the building at the time of the fire. Most were evacuated by the fire brigade, but for six people, including children, help came too late, according police in Solothurn.
Four people remain in hospital.
A police spokeswoman refused to tell the AFP news agency how many children were among the dead or injured, or provide more information about the identity of those affected.
Identification of the bodies is ongoing.
But neighbours were quoted by several media outlets suggesting that asylum seekers were living in the building. A local cafe owner told AFP he believed they were mainly Eritreans.
Preliminary investigations indicated that improper handling of a cigarette had caused the fire, police have now said. One person was detained.
Earlier on Monday, an AFP photographer said the building was intact but from the outside all of the apartments looked blackened by smoke and fire.
“A resident noticed smoke at 2:10 am (0110 GMT) in the stairwell and sounded the alarm,” the police statement said, adding that dozens of firefighters, along with police, ambulances and other rescue services were immediately dispatched to the building.
'Impossible to escape'
Solothurn city councillor Kurt Fluri told the 20 Minuten online news site that he was deeply saddened by the tragedy.
He said the fire actually appeared to have been quite small.
“It was the smoke that was the problem. It was impossible to escape from it,” he said, adding that some people “appear to have jumped out of the window”.
Another witness, a man who had been evacuated from a neighbouring building, also told 20 Minuten he had heard that some people had jumped to escape the smoke and flames.
“They panicked,” he said.
Another neighbour, 62-year-old Franco Pedone, told the Blick newspaper's online edition that he had been jolted awake.
“I suddenly heard women shouting in the night. They were screaming like crazy,” Pedone said.
And yet another neighbour told 20 Minuten that he had heard screams of people stuck in the building and had seen a child being resuscitated by emergency workers.
“That was the worst,” he said.
According to the initial findings, the fire originated on one of the lower floors, allowing smoke to spread through the building.
The neighbouring building was also evacuated “as a precaution”, police said, adding that those residents were able to return home before morning.