At least two people died and two more remained missing after tropical storm Erick grazed Mexico's Pacific coast before weakening into a tropical depression, authorities said Tuesday.

Erick, which reached the level of a category one hurricane on Saturday but never made landfall, forced 5,000 people to flee to shelters in the western state of Nayarit, but most returned home Tuesday, officials said.

The body of a 44-year-old man was found Sunday after he was apparently swept away by the Indio River, according to the state civil protection director, Martin Tapia.

A second body was found amid the rubble that was swept by the overflowing river in the town of Xalisco, Tapia said.

"We are still looking for the other two men but the search is complicated because the river dragged a lot of rubble," he said.

Xalisco, population 40,000, was hardest hit as the river swelled to as much as six meters (20 feet) more than its normal level over the weekend.

Erick was downgraded to a tropical depression Monday and was weakening further as it moved further away from the coast on Tuesday, the National Weather Service said.

It was moving northwest at a speed of around 17 kilometers per hour (10 miles per hour) with maximum sustained winds of 45 kilometers per hour (28 mph).