More than two million people were under a tropical storm warning along the Texas Gulf Coast in the early hours of Thursday as Tropical Storm Alberto, the first named storm of the Atlantic hurricane season, neared the coast of Mexico, bringing intense rain and storm surges.

The expansive storm system brought widespread coastal flooding in southern Texas on Wednesday, well before the storm was expected to make landfall. Officials in Mexico said they were cleaning drainage points to prevent flooding, and monitoring the levels of dams, rivers and streams.

At least three people were killed in storm-related events in the state of Nuevo León in Mexico, according to local media reports. One teenager was trapped by currents in a river and drowned, and two other minors were electrocuted crossing a pond that was in contact with a live cable, the El Universal newspaper reported, citing local emergency authorities.

In Texas, tides surged beneath elevated houses in some coastal cities, including Surfside Beach, about 40 miles south of Galveston, starting on Wednesday morning. The city closed its beach earlier this week and warned visitors to stay away as the flooding worsened.

The National Hurricane Center warned that Alberto was a large storm, with tropical-force winds extending about 415 miles north of its center in the Gulf of Mexico as it moved west toward northeastern Mexico. The storm had maximum sustained winds of 50 miles per hour on Wednesday night, but the main concern was rainfall of a foot or more that was predicted for parts of Texas and Mexico.

Forecasters predicted that Alberto could make landfall early Thursday near the Mexican city of Tampico, but its effects were expected to extend far beyond that. As of Wednesday night, a 700-mile stretch of coast from San Luis Pass near Galveston to Tecolutla in Veracruz, Mexico, was under a tropical storm warning, according to the National Hurricane Center.