GOMA, Democratic Republic of Congo — After a night of chaos and panic, the threat from an erupting volcano to a major city in Congo appeared to recede on Sunday when a river of boiling lava halted at the city’s northern edge.
Tens of thousands of people fled the eastern city of Goma on Saturday night when lava began to spew from the flanks of nearby Mount Nyiragongo, one of the world’s most active volcanoes, throwing up clouds of noxious fumes and filling the sky with an ominous fiery glow.
After crossing a major highway, the lava advanced toward Goma, a city of two million people which was devastated by the last eruption, in 2002, when boiling lava smothered entire neighborhoods, killed several hundred people and left at least 100,000 homeless.
Unsure which way the lava was flowing, terrified residents crammed into vehicles or fled on foot, many clutching mattresses and bags of hastily gathered belongings. At least five people died in accidents, the authorities said, as the city emptied.
Some residents headed east to the nearby border with Rwanda, where 3,500 had crossed by Sunday morning, and others fled to the west.
But the lava came to a standstill in Buhene, on the northern edge of Goma, at about 3 a.m., seven hours after the eruption was first reported, residents said. By Sunday morning the exodus had switched into reverse as residents flooded back to Goma, hoping to check if their homes had been damaged or looted.
“People are relieved but also still scared,” said Albert Muihigi, 28. “Fear is still there because there are rumors of a second wave.”
Mr. Muihigi drove his motorbike toward the lava on Saturday, he said, to see which way it was flowing so he could warn his family.
“People were terrified,” he said, adding that two old people in his neighborhood had died from heart attacks when they heard the volcano had erupted.
The sense of an apocalyptic drama on Saturday was heightened by eruptions of thunder and lightning around the volcano, as the ground shook with repeated tremors.
The United Nations peacekeeping mission in Congo posted video of a reconnaissance flight that showed a huge pool of red lava burning brightly in the nighttime darkness. As the lava moved toward the city airport, the Congolese government ordered an evacuation of the city.
The authorities in Rwanda reported that 3,500 people had crossed the border by midnight, where many found shelter in churches and empty schools.
But by Sunday lunchtime, the Congolese authorities announced that the worst was over.
“The city was spared,” Gen. Constant Ndima, the regional military governor, said in a statement.
Still, not all of Goma escaped unscathed.
In Buhene, residents returned early Sunday to find that their homes had been swallowed by a river of lava, about half a mile wide, which had engulfed an area the size of several city blocks.
Rooftops peeked through the river of steaming lava, which had started to harden, although flames still licked through cracks in places.
Some residents, lamenting their losses, tried to salvage what they could from homes on the edge of the lava. For others from different parts of the city, the site was an instant curiosity.
Some collected chunks of lava that were still warm to the touch to keep as souvenirs or took selfies. Others cooked corn cobs and manioc on the hot rocks, to the amusement of the crowd.
Nyiragongo, an 11,385-foot mountain, has long menaced the surrounding area. In 1977, thousands were killed when an eruption sent lava down the mountainside at estimated top speeds of more than 60 miles per hour.
Unusually even for an active volcano, it has a voluminous and persistent lava lake that is low in silica, which makes the lava fluid and rapid-flowing when it erupts.
If the latest eruption does prove to be a near miss, it is likely to raise questions about why the population did not receive warning. An early warning system is in place at Mount Nyiragongo, where experts who monitor temperatures, gas emissions and seismic activity at the volcano.
But earlier this year, the World Bank cut funding to the organization that runs the system, the Goma Volcano Observatory, amid corruption accusations. With its funding cut, volcanologists struggled to collect data.
In March, as the volcano’s crater refilled with magma, some warned of potentially disastrous consequences.
“The population won’t have time to evacuate and people will die,” the volcanologist Honore Ciraba told Reuters.
During the 2002 eruption, the damage to Goma was exacerbated by exploding fuel stations in the city. Those killed including older people who had been unable to flee in time, and looters who moved through empty houses.
Apparently taking lessons from that chaos, tankers moved fuel out of the city on Saturday to avoid explosions. In the capital, Kinshasa, the government activated its evacuation plans for Goma.
Tremors from the volcano continued into Sunday afternoon in Goma, prolonging the sense of trepidation among residents and worries the crisis was not entirely over. But Patrick Muyaya, a spokesman for the Congolese government, said it appeared to have passed.
“Local authorities who have been monitoring the eruption overnight report that the lava flow has lost intensity,” he said on Twitter.
Finbarr O’Reilly reported from Goma, Democratic Republic of Congo, and Declan Walsh from Nairobi, Kenya. Austin Ramzy contributed reporting from Hong Kong and Steve Wembi from Kinshasa, Congo.