An unusual torrent of rain and flash flooding hit the San Diego area on Monday, shutting down highways, swamping roads and leaving some residents to watch helplessly as water swept away their cars or wreaked havoc on their homes.

The deluge caught many off guard, as up to three inches fell in the span of three hours, according to the National Weather Service. By early afternoon, the agency noted that the San Diego River was actively flooding, with water levels still rising.

As reports of damage surfaced, Todd Gloria, the mayor of San Diego, declared a state of emergency and urged residents to avoid any unnecessary travel. Mr. Gloria said the city was coordinating efforts with local, state and federal agencies to ensure a comprehensive response. Displaced residents were directed to an evacuation center set up by the American Red Cross.

Officials found themselves fielding numerous rescue calls in an area that received more rain on Monday than it did during the much feared Tropical Storm Hilary last August.