Ernesto came ashore after spinning across the far southern Gulf of Mexico in waters dotted with oil rigs operated by the state oil company. The government closed its largest Gulf coast port, Veracruz, and the smaller ports of Alvarado and Coatzacoalcos.
In neighbouring Tabasco state, two fishermen drowned when the stormed passed through the area, Gov. Andres Granier told reporters.
Granier said the storm's strong winds ripped rooftops from several homes but residents refused to evacuate, fearing their possessions might be stolen. "People have chosen to stay in their homes and we are helping them," he said.
Coatzacoalcos, a major oil port, got seven inches (177 millimeters) of rain in the 24 hours before Ernesto's centre passed just a few miles (kilometres) away, according to Mexico's weather service. San Pedro in the neighbouring state of Tabasco had seen more than 10 inches (273 millimeters).
"It's raining intermittently. It rains, its stops, and then it rains again," said Juventino Martinez, the civil defence chief in Coatzacoalcos. "We have some flooding, some water building up" on streets in lower-lying sections of the city. He said 40 shelters were ready but hadn't been used yet.
Municipal employee Brito Gomez reported water was waist high in some neighbourhoods.
About 2,000 army and navy personnel were on standby to head to inland mountains to help in rescue work if needed, said Noemi Guzman, Veracruz state civil defence director. Guzman said no flooding had been reported at any of the state's many rivers.
The U.S. National Hurricane Center said Ernesto's sustained winds had declined to 40 mph (65 kph) by late Thursday, just above the minimum 39 mph to be considered a tropical storm. It said the storm would continue weakening through the night and should dissipate by morning, although forecasters warned that heavy rains could continue into Friday night.
Ernesto was a weak hurricane when it made its first landfall late Tuesday near the cruise ship port of Mahahual in Yucatan, but it weakened as it crossed the peninsula and then spun into the Gulf of Mexico on Wednesday night.
Late Thursday, the storm was centred about 85 miles (135 kilometres) southwest of the port city of Veracruz, moving to the west at 14 mph (22 kph).
The U.S. hurricane centre said Ernesto still had the potential to cause flooding and could produce rainfalls of up to 15 inches in some parts of the mountainous areas of Veracruz, Tabasco, Puebla and Oaxaca states before dissipating.
With many small communities clinging to hillsides in those states, authorities worried about potential flash floods and mudslides.
There were no reports of major flooding in Veracruz state and there have been only minor landslides on some roads, said Raul Zarrabal, the state's communications secretary.
"No community has been cut off because of these landslides because they were immediately cleared with heavy machinery so there are no blocked roads," Zarrabal added.
Soldiers and state police evacuated three communities in Los Tuxtlas, in southern Veracruz state, due to rising rivers and streams. People in two neighbourhoods in the town of Alvarado were also temporarily relocated due to high waters.
The state oil monopoly, Petroleos Mexicanos, said it had evacuated 61 workers from a drilling platform and had taken other safety precautions, but said oil production had not been affected.
A new tropical depression formed in the Atlantic on Thursday far from land. It was the seventh tropical depression to form in the Atlantic and forecasters said it was moving rapidly. By Thursday night, it had maximum sustained winds of 35 mph (55 kph) and was 1,045 miles (1,680 kilometres) east of the Windward islands.
The Atlantic hurricane season got off to an early start and will likely stay busy, producing a few more storms than originally predicted, U.S. forecasters said Thursday.
Forecasters said warmer-than-normal sea surface temperatures and wind patterns that favour storm formation mean chances are higher for an above-normal season. However, that is tempered with the expected development of an El Nino weather pattern over the Pacific that may suppress storms later in the season.
In the Pacific, Gilma weakened from a hurricane to a tropical storm and was not seen as a threat to land. It was about 695 miles (1,115 kilometres) west-southwest of the southern tip of Mexico's Baja California Peninsula, with maximum sustained winds near 70 mph (110 kph).
Associated Press writer Mark Stevenson in Mexico City contributed to this report.