LOS ANGELES — More than a dozen people in inland Southern California were rescued after a flash flood stranded their cars early Thursday as a major storm took parting shots as it moved out of the state.

Five vehicles got stuck shortly after 1 a.m. as several feet of mud and water roared over a rural road near Gilman Hot Springs north of Hemet, Riverside County Fire Department officials said.

California Highway Patrol Sgt. Adrian Horta said a woman in one car was "hanging out of the passenger side of her vehicle screaming for help."

Horta said he was able to drive his all-wheel-drive SUV alongside the car and pull the woman and her male companion out through the driver's side window.

"The mountain slide had come down and it was about four feet deep," he told KCBS-TV. "I was able to drive them back to safety before the fire department got there."

A Fire Department swift water rescue crew rescued the remaining motorists. In all, 14 people were pulled from their cars, but no injuries were reported.

Residents of several nearby homes were evacuated as a precautionary measure, fire officials said. Numerous roads in the inland region were closed, and flash flood warnings were in effect through midmorning as the outgoing storm stalled over the area.

The diminishing Pacific system brought three days of rain to drought-stricken California. There was some flooding and evacuations in areas where hillsides stripped bare by wildfires, but major damage was avoided in the Los Angeles metropolitan area despite some huge rainfall totals. One location, Yucaipa Ridge in the San Bernardino Mountains, received an exceptional 14.5 inches of rain, the National Weather Service said.

Most other parts of the state received totals between 2 inches and 4 inches.

The storm dropped snow in mountains key to the state's water supply, and it made signature waterfalls flow at Yosemite National Park, including the 2,425-foot Yosemite Falls that had slowed to a trickle in mid-July.

"With the precipitation, they are looking good. They are flowing nicely," park spokeswoman Ashley Mayer said.

There were problems. The storm was the likely cause of a pair of sinkholes in San Francisco, including a 20-by-30-foot chasm in a neighborhood.

And Sacramento's Wednesday evening rush-hour commute was disrupted by freeway flooding, with lanes blocked along Highway 51, known as Capital City Freeway, and farther north along Interstate 80.

In the San Francisco Bay Area, the rain brought the region close to or beyond normal annual rainfall totals for the first time in years.

Just before the storm arrived, the Sierra Nevada snowpack — which accounts for most of the state's water supply — was at just 24 percent of normal for this time of year. But snow was building rapidly with reports of 10 inches of snowfall at elevations of 8,000 feet.

That good news was tempered by a stark reality: California needs many more such storms to pull itself out of a three-year drought.

Associated Press writers John Antczak in Los Angeles and Kristin Bender in San Francisco contributed to this report.