A San Francisco man was sentenced Monday to 439 years to life in prison for burglarizing and robbing four older victims in the Nob Hill neighborhood.

Dwayne Whitaker, 51, was found guilty of committing a series of attacks in July and August of 2008 on the four victims as they entered their residences with groceries in hand, according to the district attorney’s office.

Three of the victims were older than 65, and one victim was 55, and they were unable to defend themselves. Three were hospitalized, but one victim managed to call for help and his partner and neighbors were able to catch Whitaker and hold him until police arrived, prosecutors said.

Whitaker was deemed incompetent to stand trial until April 2013, and then sought to plead not guilty by reason of insanity. He was eventually found guilty of two counts of first-degree burglary, one count of first-degree robbery, one count of attempted robbery, two counts of assault, elder abuse with great bodily injury, and receiving or buying stolen property.

“This man preyed upon the elderly and defenseless,” District Attorney George Gascón said in a statement. “His actions were repulsive, and the sentence he received ensures he will never be able to hurt anyone again.”

Prosecutors asked for a life sentence for Whitaker because he had previously been convicted of crimes that counted as strikes under the state’s “three strikes” law. Judge Gail Dekreon sentenced him to 439 years to life, to the relief of Whitaker’s victims.

“The incident left me fearful and scared to leave my home,” said Robin Currier, one of his victims. “I’m relieved that I’ll never have to look over my shoulder and see this man, and I hope elderly San Franciscans share my sense of relief.”