BEIRUT — As dazed Lebanese on Wednesday picked through the wreckage inflicted by a massive explosion in their capital city, shock turned to anger at the corruption and incompetence that allowed a massive pile of dangerous chemicals to sit unattended in a warehouse at Beirut's port for six years.

An estimated 2,750 tons of ammonium nitrate, a fertilizer and bombmaking ingredient, has been identified as the immediate cause of the blast that engulfed the city on Tuesday, killing at least 135 people, injuring more than 3,000 and leaving more than 100 unaccounted for. The material had been stored in a warehouse since being seized by customs authorities in 2014, despite repeated warnings from port officials that it was a risk.

Government investigators still have not pinpointed the origin of the fire or explosion that erupted some 15 to 20 minutes before the ammonium nitrate ignited, sending a vast mushroom cloud of toxic gases rippling across the city. The blast was heard 150 miles away on the island of ­Cyprus.

Beirut has witnessed many explosions, including the bombing of the U.S. Marine barracks in 1983 that killed 241 Marines, the assassination of former prime minister Rafiq al-Hariri in 2005 and the countless mortar rounds and shells that rained down on the city during the civil war from 1975 to 1990.

This was by far the biggest — and the shock waves reverberated beyond the immediate tragedy of lost lives and homes. It seemed to encapsulate everything that is wrong with Lebanon at this point in its turbulent history: a weak state, inept government, corrupt officials and, many said, the existence of a parallel state run by the powerful Hezbollah movement, as well as other Lebanese factions that used the port for smuggling operations.

“People saw firsthand with devastating results what it means to have a failed state,” said Paul Abi Nasr of the Lebanese Association of Industrialists. “It’s not just that the government is corrupt, that the state is weak, that there are weapons outside the hands of the government. We saw these things come together catastrophically.”

Nations around the world rushed to offer assistance, with planes bearing humanitarian aid and medical teams landing or due to arrive from Turkey, Qatar, Kuwait, Egypt, France, Iran and Britain, among others.

President Trump said Thursday that no one could say what caused the blast but that the United States was “looking into it very strongly.” Secretary of State Mike Pompeo offered U.S. help in a telephone call with the country’s Hezbollah-backed prime minister, Hassan Diab, with whom Washington has had frosty relations. Pompeo conveyed the United States’ “steadfast commitment to assist the Lebanese people as they cope with the aftermath of this terrifying event,” the State Department said in a statement.

But the offers of aid did little to alleviate the bitterness on the streets of Beirut.

“Even if foreign countries send help, the government will steal it,” said a 23-year-old student who was among hundreds of volunteers who showed up to help clear the streets of debris and broken glass.

In any case, she said, “we will not be able to repair all this.”

Protesters gathered in the central Martyrs’ Square shortly after midday. Some were in tears.

As the day wore on, the vastness of the devastation became clear. People milled around the wrecked streets of some of Beirut’s most vibrant and wealthiest neighborhoods in stunned disbelief at the scale of the damage. Volunteers swept away debris and broken glass as people who lived in the stricken area retrieved possessions.

Windows were blown in and doors blown out across a vast swath of the mostly Christian eastern sector of the city. Many of the buildings were rendered uninhabitable, cracked or buckled beyond repair. They included some of Beirut’s fanciest new high-rise apartment complexes and the quaint historic houses for which the area is renowned.

The governor of Beirut, Marwan Aboud, said more than 300,000 people in the city of 2.2 million had been left homeless. The Lebanese government said it was putting an unspecified number of Beirut port officials under house arrest as it began an investigation into the blast.

The losses were staggering. The Lebanese Red Cross said any additional bodies found in the rubble must be taken to Beirut’s morgues directly because hospitals could no longer cope.

Residents of Gemmayzeh, a historic neighborhood once dotted with bars and restaurants, dragged suitcases over piles of broken glass and rubble to seek housing elsewhere.

“We have no home anymore. The ceiling came down,” Pierre Feghali said as he tried to start his wrecked car to drive with his wife to his ancestral home in the mountains outside Beirut.

Aboud put the cost of the damage at as much as $5 billion. Whatever costs are eventually incurred will be added to the estimated $100 billion in banking sector losses that had already wiped out the savings of ordinary people.

The prospect of rebuilding at a time when bank rules prohibit people from withdrawing more than small amounts from their accounts was daunting to many of those surveying wrecked homes and businesses. At the House of Butlers, a hip bar known for its many varieties of whiskey, the stench of alcohol hung over a staff retrieving unbroken bottles.

There was no talk of rebuilding, only of salvaging what could be saved, said Ayman Zayour, one of the bartenders loading whiskey into a van.

“We really don’t know how we will recover from this,” he said. “We were already in economic crisis.”

Many voiced similar sentiments, saying they were more inclined to leave the country than try to rebuild their shattered lives, perhaps only to see them knocked down by another crisis.

“For me, this is the end,” said Nabil Allam, the financial manager of the badly damaged Rosary Sisters Hospital, which evacuated patients to other hospitals that were already overwhelmed.

“Do you think the politicians can solve this?” he asked. “This is bigger than any of them.”

Allam was at his home three miles outside the city when explosions lighted up the sky. He turned to his wife.

“It’s Hiroshima,” he told her.

Diab appealed for global help to stanch the suffering. French President Emmanuel Macron was scheduled to arrive in Beirut on Thursday. The European Union said it was activating its civil protection system to round up emergency workers and equipment from across the 27-nation bloc. A video shared on social media showed French firefighters at Charles de Gaulle Airport in Paris, preparing to assist.

The toll is expected to rise as more bodies are unearthed in the wreckage of the port area. An Instagram account set up to appeal for information on the missing included photographs of more than 100 people, including firefighters and civil defense workers who rushed to the scene of the initial fire only to be caught in the far larger blast that followed.

They are unlikely to be found alive, said Freddy, a firefighter at the port who had been on duty for 22 hours. “The whole ground turned inside out,” he said as an ambulance sped past.

Simon Abegi hunted for his friend Rwan Misto, a fellow bartender at the Cyrano cocktail bar. She was standing next to him in the bar when the explosion struck. While he picked himself up, she was still lying on the ground, bleeding profusely. Bystanders put her in a car to take her to a hospital. She has not been heard from since.

Loveluck reported from Baghdad. Suzan Haidamous and Missy Ryan in Washington contributed to this report.