But a guard stopped her and told her that there had been a fire in the neonatal unit. None of the newborns had survived.
Ba, 30, was shattered. Her only crumb of comfort was that her newborn daughter and son had been healthy enough to be taken home from the ward on Wednesday afternoon, just hours before the tragedy struck.
The triplets were born at the hospital by caesarean section on May 9. All are still to be named.
"God saved my two babies. This is God's will, it hurts a lot, but it's God's will," Ba told Reuters, as she nursed her boy and girl on a bed in a dimly-lit room in Keur Assane Mbaye, a hamlet surrounded by sandy shrubs an hour from Tivaouane.
"I was able to recover my two babies. I can only give thanks."
Witnesses said an explosion had ripped through the ward containing 11 incubators holding newborns.
Ba, like others, is struggling to bear the pain as she awaits answers from the hospital and the government about what went wrong.
"The hospital did not tell us what exactly happened. We have no information on how we will bury our children. The hospital hasn't told us yet," she said.
The hospital and a government spokesperson declined to comment on the incident while an investigation was underway.
The blaze at Tivaouane is just the latest in a string of disasters to strike Senegal's underfunded hospitals.
In April last year, four babies died in a hospital fire in the northern town of Linguere.
The government has launched an investigation into what caused Wednesday's blast. President Macky Sall also sacked his health minister and declared three days of national mourning.
Tivaouane's mayor, Demba Diop Sy, told reporters that late on Wednesday, as two nurses in the neonatal unit were doing their rounds, a short-circuit in the locked room caused a sudden explosion, knocking them both unconscious.
Sy, who rushed to the scene on Wednesday night, said the fire had been brought under control within 10 minutes.
Outside the building, the only visible sign of the blast is a streak of black smoke staining the wall around a shattered window of the top floor of the two-storey turquoise building.
Mamadou Mbaye, a Tivaouane resident, said he had been accompanying a relative to the hospital's radiology ward when he heard that a fire had broken out at the neonatal unit.
"I ran over. I saw women crying and screaming. I then went up to the second floor and the midwives were there, they were screaming and screaming. It was dark, there was a lot of smoke and it was extremely hot," Mbaye told journalists.
A friend who accompanied him then forced open the door of the unit, he said. But it was already too late for the babies.
(Reporting by Bate Felix and Ngouda Dione; Editing by Mike Collett-White and Gareth Jones)
By Ngouda Dione and Bate Felix