The king said he was shocked by the extent of the devastation in the residential area.
"My knees are shaking," he told reporters at the end of the visit.
The king and queen expressed their condolences to victims and relatives during a meeting at a neighbourhood centre.
There were two explosions at the three-storey apartment building on Saturday morning.
Six people are known to have died.
Police identified three of the dead as members of one family - a man aged 45, a woman aged 41 and their 17-year-old daughter.
Only the family's eight-year-old son survived.
They identified a fourth dead person as a 31-year-old man.
Four people were injured and taken to hospital.
The search for victims ended after trained dogs searched the last basement.
The investigation into the cause of the explosion is continuing.
According to the public prosecutor, there are indications that a crime was committed but other causes are not being ruled out.
The driver of a car that drove away from the scene at high speed shortly after the explosion is still being sought.