Texas laws that allow residents to carry arms into places of worship saved more than 240 people during a church shooting over the weekend, President Donald Trump said in a statement.

On Sunday, two died when a gunman opened fire at the West Freeway Church of Christ in White Settlement, Texas before being shot and killed himself by a church security team member.

"It was over in 6 seconds thanks to the brave parishioners who acted to protect 242 fellow worshippers. Lives were saved by these heroes, and Texas laws allowing them to carry arms," Trump said via Twitter on Monday.

In a Facebook post after the incident, church security head Jack Wilson, who killed the gunman, said evil exists and he had to take out an active shooter. Wilson also said he and other church members are not going to allow evil to succeed.