A gunman opened fire with an assault rifle at dinner time into a San Diego restaurant, but no one was hurt in what police said was an "amazing" outcome.

Police recovered at least 19 shell casings after the shooting Tuesday outside the restaurant in the city's Hillcrest neighborhood.

"It's quite a blessing when that much, that hail of gunfire that went out, there was nobody hit," police Lt. Andra Brown told the San Diego Union-Tribune .

It's "amazing that nobody was hurt," she said.

Police detained a suspect about 20 minutes later and found the discarded gun nearby. A motive had not been determined.

The attack occurred in a busy area of bars and restaurants.

Police said they did not have the exact number of patrons inside the restaurant at the time of the shooting. Some people reported being hit by shattered glass.