The bravery of a security guard who was shot dead along with two other worshippers at a San Diego mosque on Monday prevented the attack from being much worse, say police.

The guard was Amin Abdullah, a father of eight, a spokeswoman for the Council on American-Islamic Relations-San Diego (Cair-SD), Tazheen Nizam, told the BBC.

It's fair to say his actions were heroic, San Diego Police Chief Scott Wahl told a news conference. Undoubtedly, he saved lives today.

Abdullah and two others - whom Cair-SD named as Mansour Kaziha and Nader Awad - were killed by two yet-to-be-identified teenage attackers who then took their own lives, say police.

Police said on Tuesday that as the suspects ran past Abdullah at the mosque's entrance, he began shooting, and they returned fire.

He also enacted lockdown procedures and is credited with saving numerous lives, including those of 140 children at the school that is part of the centre, Wahl said at a briefing on Tuesday.

The two other victims then drew the attention of the suspects in a parking lot, where they were fatally shot. Wahl said the response that Abdullah initiated undoubtedly pushed the suspects to flee.

Wahl praised all three victims for deterring additional fatalities.

People who knew Abdullah told US media he looked after the community. Others have taken to social media to describe him as the nicest man you'll ever meet.

The mosque called him a courageous man who put himself on the line of the safety of others, who even in his last moments did not stop protecting our community.

Nizam, the Cair spokeswoman, told the BBC: Amin was loved by everybody, he stood there day after day, always smiling, welcoming everybody, welcoming the kids who came to the school.

He was a shining light. He is a true hero, a martyr.

A friend of the family told the Associated Press that Abdullah was well-known at the mosque and had worked there for more than a decade.

On Tuesday evening, ahead of a community vigil, his daughter Hawa Abdullah, flanked by her siblings, said her father would want our community to stand together as one.