A man in Alabama walked into church, sat down, and then began shooting, injuring his girlfriend, their infant son, and the pastor who tried to intervene, Selma police said.

James Minter, 26, walked into Oasis Tabernacle Church in Selma shortly before 10:30 a.m. and sat between his girlfriend and the child at the front of the church, police said in a release.

“Shortly after, he pulled a handgun and started shooting,” the release said. “The girlfriend fell to the ground.”

When the pastor intervened, grabbing Minter, he was too was shot, police said.

The girlfriend, 24, was shot in the shoulder and jaw, her 1-month-old child was injured in the hand and the pastor, 61, was shot in the leg, police said. Witnesses identified the woman as Minter’s boyfriend and the infant as their child, police said.

NBC station WSFA reported that the woman and the child were being treated at hospitals in Birmingham and are stable. The pastor was treated at a local hospital.The victims’ names were not released.

Bystanders grabbed Minter after the shooting and took his gun, but he escaped and fled on foot, police said.

He was caught less than a mile away and was arrested on suspicion of three counts of attempted murder and was being held without bond at the Dallas County Jail, police said.

Detectives believe the shooting may relate to child visitation issues and ongoing domestic violence between Minter and his girlfriend, the release said.