The blast in Beirut killed at least 135 people and injured more than 4,000 others. A two-week state of emergency has begun.
President Michel Aoun said the blast was caused by 2,750 tonnes of ammonium nitrate stored unsafely in a warehouse.
Customs chief Badri Daher said his agency called for the chemical to be removed, but "this did not happen".
Opening an emergency cabinet meeting on Wednesday, President Aoun said: "No words can describe the horror that has hit Beirut last night, turning it into a disaster-stricken city".
Specialists at the University of Sheffield in the UK estimate that the blast had about one tenth of the explosive power of the atomic bomb dropped on the Japanese city of Hiroshima during World War Two and was "unquestionably one of the biggest non-nuclear explosions in history".
The ammonium nitrate had reportedly been in a warehouse in Beirut port for six years after it was unloaded from a ship impounded in 2013.
The head of Beirut port and the head of the customs authority both told local media that they had written to the judiciary several times asking that the chemical be exported or sold to ensure port safety.
Lebanon's Supreme Defence Council has vowed that those found responsible will face the "maximum punishment" possible.
House arrest would apply for all port officials "who have handled the affairs of storing [the] ammonium nitrate, guarding it and handling its paperwork" since June 2014, Information Minister Manal Abdel Samad said.
Volunteers have poured onto the streets of Beirut to help clear up the devastation while others have been visiting the worst affected areas in a state of shock.
The government has been promising a full and transparent investigation and told the military to put those responsible for storing the vast quantity of ammonium nitrate under house arrest.
Security forces have sealed off a wide area around the blast site, and rescuers have been looking for bodies and survivors under rubble while boats searched the waters off the coast. Many people are still missing.
Public Health Minister Hamad Hassan said Lebanon's health sector was short of beds and lacked the equipment necessary to treat the injured and care for patients in critical condition.
He said a "large number of children" had been rescued but added that he feared that the number of dead would rise further.
The Saint Georges hospital near the site of the explosion was badly damaged and several members of staff were killed. Three Beirut hospitals were closed with two others only partially operational, the World Health Organization (WHO) said. The body said it would airlift medical supplies to Lebanon on Wednesday evening.
A number of countries have offered humanitarian assistance. Three French planes are due to arrive carrying 55 rescuers, medical equipment and a mobile clinic equipped to treat 500 people, and President Emmanuel Macron will visit on Thursday.
The EU, Russia, Tunisia, Turkey, Iran and Qatar are all sending relief supplies. The UK is also ready to send medical experts and humanitarian aid, Foreign Secretary Dominic Raab said.
About 300,000 people have had to leave damaged homes
President Aoun announced that the government would release 100 billion lira (£50.5m; $66m) of emergency funds but the impact of the blast on the economy is expected to be long-lasting.
Darul Ihsan Media Desk