Typhoon Rammasun_June17
A worker clears debris on a bridge destroyed during the onslaught of Typhoon Rammasun, (locally named Glenda) in Batangas city south of Manila on July 17, 2014. Reuters/Erik De Castro

(Reuters) - The Philippines set to work clearing debris, reconnecting power and rebuilding flattened houses on Thursday after a typhoon swept across the country killing 38 people, with at least eight missing, rescue officials said.

Typhoon Rammasun, the strongest storm to hit the Philippines this year, was heading towards China after cutting a path across the main island of Luzon, shutting down the capital and knocking down trees and power lines, causing widespread blackouts.

The storm destroyed about 7,000 houses and damaged 19,000, the executive director of the National Disaster Agency, Alexander Pama, said. More than 530,000 people had taken refuge in evacuation centers, according to official figures.

Pama put the damage to crops, mostly rice and corn, from the Bicol region, southeast of Manila and the first to be hit by the storm, at around 668 million pesos, or about $15 million.

Most schools remained closed in the capital and southern Luzon, the most densely populated part of the country with about 17 million people. Power had been restored to just over half of the Luzon grid, a transmission agency official said.

Electricity distributor Manila Electric Co said a third of its 1.88 million customers were without power.

Disaster officials were still assessing damage but the coconut-growing Quezon province south of Manila appears to have borne the brunt of Rammasun, which intensified into a category 3 typhoon as it crossed the country.

Tropical Storm Risk, which monitors cyclones, has downgraded Rammasun to a category 1 storm on a scale of one to five as it headed northwest towards China.

But it predicted it would gain in strength to category-two within 24 hours, picking up energy from the warm sea as it headed in the direction of China's Hainan island.

Quezon governor David Suarez said the province was preparing to declare a state of calamity. He said officials had confirmed seven people died in the province.

"Last night we had difficulty going around because many trees and fallen poles are blocking highways and roads," Suarez said in a radio interview.

Pama said on Wednesday the government was more prepared after the devastation caused by Super Typhoon Haiyan in November, evacuating people at risk in coastal and landslide-prone areas well before the typhoon made landfall.

Parts of the Philippines are still recovering from Haiyan, one of the biggest cyclones known to have made landfall anywhere. It killed more than 6,100 in the central provinces, many in tsunami-like sea surges, and left millions homeless.