MEXICO CITY — Tropical Storm Pilar pelted the coast of western Mexico with heavy rains and winds Sunday night as it kept just offshore in the Pacific after passing near the resort city of Puerto Vallarta.

Pilar had maximum sustained winds of 40 mph (65 kph) and its center was about 95 miles (155 kilometers) south of Mazatlan. The storm was moving north at about 8 mph (13 kph).

The storm was projected to closely hug the coast for the next few days and lose strength while dropping rain on Nayarit and Sinaloa states. Tropical storm force winds extended out as far as 60 miles (95 kilometers).

The U.S. National Hurricane Center said Pilar was likely to bring 3 to 7 inches (7.5 to 17.5 centimeters) of rain to coastal regions.

Meanwhile, two hurricanes were lurking in the Atlantic without posing an immediate major threat to land.

Hurricane Maria, which walloped Puerto Rico as a Category 4 hurricane last week, was a Category 2 storm and its maximum sustained winds had weakened to 90 mph (150 kph). It was moving north at 8 mph (13 kph) and was predicted to cause heavy surf and swells on the Carolina and the Mid-Atlantic coasts.

It was centered about 385 miles (625 kilometers) south-southeast of Cape Hatteras, North Carolina.

Farther out at sea, Hurricane Lee had maximum sustained winds of 90 mph (150 kph). It was about 900 miles (1,450 kilometers) east of Bermuda and was moving to the east-southeast at 3 mph (6 kph). It was projected to move in a rough circle over the coming days.