Mountain communities in two Mexican states are recovering from weekend mudslides that killed 39 people during heavy rains brought by remnants of Hurricane Earl.

On the other side of Mexico, authorities prepared as newly formed Tropical Storm Javier churned over the Pacific toward the resort-dotted southern end of the Baja California Peninsula. Forecasters said it would close in on that area early Tuesday as a hurricane.

At least 28 people died in multiple mudslides in the mountainous north of Puebla state, National Civil Protection Coordinator Luis Felipe Puente said Sunday in an interview with ForoTV. He said 25 were killed in different parts of the township of Huauchinango and three died in Tlaola.

"It is a tragedy what has happened to our people in Huauchinango," Gabriel Alvarado, mayor of the township of Huauchinango, said in a statement issued before the full death toll had been determined. He said the torrential rain caused damage affecting at least 200 people.

In neighboring Veracruz state, 11 people lost their lives when mudslides hit the towns of Coscomatepec, Tequila and Huayacocotla, Gov. Javier Duarte said.

The continuing heavy rain led officials to close a section of the main federal highway connecting Mexico City to the region. Federal transportation authorities said the area had received a month's worth of rain in 24 hours.

Meanwhile, Tropical Storm Javier formed off Mexico's Pacific Coast on Sunday and headed northward.

Javier had sustained winds of about 50 mph (85 kph) and was centered about 210 miles (340 kilometers) southeast of Cabo San Lucas late Sunday, the U.S. National Hurricane Center said. It was moving west-northwest at about 13 mph (20 kph).Heavy rains of between 4 and 8 inches (10 to 20 centimeters) were expected, along with high winds. A tropical storm warning was in effect for the southern portion of the Baja California.