VERACRUZ, Mexico — Tropical Storm Barry weakened to a depression after hitting Mexico's Gulf Coast on Thursday and forcing the evacuation of four towns near a rain-swollen river.

The second tropical storm of the Atlantic hurricane season had maximum sustained winds near 35 mph (55 kph) in the evening and tropical storm force gusts were possible along the coast of eastern Veracruz state.

The government of Mexico discontinued the storm warnings for Veracruz but state authorities moved about 1,000 people from towns along the Rio Bobos in the northern part of the state, which was being hit by more than seven inches of rain, sending the river's level rising by more than two feet.

Classes were canceled around the state but flights were operating normally out of the main airport in the city of Veracruz and schools were expected to reopen Friday.

Veracruz state Civil Protection Secretary Noemi Guzman said 2,000 shelters had been readied in the state with mattresses, blankets, water and canned food. She said the shelters at schools and recreation centers could house up to 306,000 people.

The port of Veracruz was closed to small vessels because of the strong winds, Guzman added.

The storm had formed as a depression off the coast of Belize on Monday and began moving northward, dumping heavy rains on parts of that country and northern Guatemala before entering the Gulf of Mexico off Mexico's Bay of Campeche and strengthening somewhat over warm Gulf waters.

The storm was expected to begin breaking apart Friday as it crosses southern Mexico, the hurricane center said.