Ecuadoreans began burying loved ones felled by the country's deadliest earthquake in decades, while hopes faded that more survivors will be found.

In the small town of Montecristi, near the port city of Manta, two children were among those buried Tuesday. They were killed with their mother while buying school supplies when the magnitude-7.8 quake struck Saturday night.

The funeral had to be held outside under a makeshift awning, because the town's Roman Catholic church was unsafe from structural damage. Family members wailed loudly and one man fainted as the children were laid to rest in an above-ground vault.

Scenes of mourning multiplied all along Ecuador's normally placid Pacific coastline, where the tremor flattened towns and killed hundreds. Funeral homes are running out of caskets to accommodate so many casualties, and local governments are paying to bring in caskets from other cities.

The government put the death toll at 507 late Tuesday, but officials expected more bodies to be found, with the Defense Department reporting 231 people still missing. The final toll could surpass casualties from earthquakes in Chile and Peru in the past decade. Among the dead were at least nine foreigners, including an American and two Canadians.

Even as grief mounted, there were glimmers of hope.

In several cities Tuesday rescuers with sniffer dogs, hydraulic jacks and special probes that can detect breathing from far away continued to search for survivors among the rubble. At least six were found in Manta early Tuesday.

One of the most-hopeful tales was that of Pablo Cordova, who held out for 36 hours beneath the rubble of the hotel where he worked in Portoviejo, drinking his own urine and praying that cellphone service would be restored before his phone battery died. He was finally able to call his wife Monday afternoon and was pulled from the wreckage soon after by a team of rescuers from Colombia

Cordova's wife had given up on ever seeing him again and managed to buy a casket.

"They were organizing the funeral, but I've been reborn," Cordova said Tuesday, grinning from beneath his bushy mustache in a provincial hospital. "I will have to give that coffin back because I still have a long way to go before I die."

Rescuers who have arrived from Mexico, Colombia, Spain and other nations said they would keep searching for survivors Wednesday, but cautioned that time was running out and the likelihood of finding more people alive grew smaller with the passage of every hour.

Even as authorities begin to shift their attention to restoring electricity and clearing debris, the earth continued to move. Late Tuesday afternoon, a magnitude-5.5 tremor rattled buildings in the region. It was the second strongest of more than 400 aftershocks since the weekend quake and was felt 105 miles (170 kilometers) away in the capital of Quito.

Saturday's earthquake destroyed or damaged about 1,500 buildings, triggered mudslides and left some 20,000 people homeless, the government said. It was the worst tremor in Ecuador since one in 1949 killed more than 5,000 people.

Some 13 nations are involved in the relief effort. Cuba sent doctors, Venezuela has flown in food and the U.S. government said Tuesday that it was sending a team of disaster experts as well $100,000 in assistance.

President Barack Obama spoke by phone with Ecuadorean President Rafael Correa on Tuesday. The White House said Obama offered condolences on behalf of the American people for lives lost.

The United Nations' top official for emergency relief, Undersecretary General for Humanitarian Affairs Stephen O'Brien, toured devastated areas to see how aid pouring into the country can be best directed to ravaged communities.

Correa has spent the past days overseeing relief efforts and delivering supplies. He said Tuesday the quake caused $3 billion in damage, about 3 percent of gross domestic product, and rebuilding would take years.

"It's going to be a long battle," he told reporters.

After a deadly earthquake in Chile in 2010, that South American country was able to get back on its feet quickly thanks to a commodities boom that was energizing its economy. But Ecuador must rebuild amid a deep recession that has forced austerity on the OPEC nation's finances. Even before the quake, the International Monetary Fund was forecasting the oil-dependent economy would shrink 4.5 percent this year.