Updated

A man armed with two handguns opened fire inside a Denny's restaurant during the lunch hour Wednesday, killing two people and wounding a married couple before taking his own life, police said.

As many as 15 people were inside the restaurant at the time, authorities said. Many fled or hid in bathrooms for safety.

"The shooter randomly and calmly walked down the aisle and started shooting," said police Chief Joe Cortez, describing a surveillance video.

The gunman was identified as Lawrence E. Woods, 60, who was believed to be living in his car, Cortez said. The slain men were identified as Harold Hatley, 73, and Frank Velasquez, 65.

The wounded couple were listed in good condition and expected to be released from a hospital, authorities said.

Investigators believed the gunman's motive could be unrelated to the restaurant or its employees after a witness told them about something the gunman said. They declined to give details. None of the victims worked at the restaurant.

The man, armed with a semiautomatic handgun and a revolver, began shooting within a few steps of the restaurant's front door, the chief said. It was unclear how many shots he fired.

Authorities were trying to determine whether the gunman had a history of mental illness or whether there were drugs or alcohol in his system, Cortez said. His car was towed from the restaurant's parking lot by investigators.

Cindy Tabelin of Stockton said she and her mother were entering the restaurant when the shooting began. She said her 68-year-old cousin, who was inside with his wife and young granddaughter, was among the victims.

Her cousin's granddaughter was not shot, but "she just watched her grandfather get killed," Tabelin told The Tribune of San Luis Obispo as she sat on a curb in the restaurant parking lot.

Denny's said it was cooperating with police.

"We are shocked and saddened by this tragic incident," the Spartanburg, S.C.,-based restaurant chain said in a statement. "This appears to be a random act of violence."

Pismo Beach, a small town known for its beaches and clams, is in San Luis Obispo County, a 3 1/2-hour drive northwest of Los Angeles.