CNN  — 

A mother, her newborn, and a pastor were shot Sunday in an Alabama church, and the baby’s father is in custody, authorities said.

James Junior Minter, 26, is accused of opening fire inside the Oasis Tabernacle Church in Selma, Alabama. He faces three counts of attempted murder, Dallas County District Attorney Michael Jackson told CNN.

“The mother is in critical condition. She and the baby were sent to Birmingham for medical treatment. The pastor is at a local hospital in Selma,” Jackson said.

James Junior Minter

The pastor was shot as he tried to get the gun out of the shooter’s hand, he said.

According to a statement from Selma police, Minter entered the church and sat between his child and the mother, who was his girlfriend. He started shooting soon after.

The girlfriend was shot in the shoulder and the jaw, police say. Her child was shot in the hand. The pastor, who police say grabbed Minter and helped to subdue him, was shot in the leg.

Minter allegedly fled the scene but was captured by police less than a mile from the church.

Possible motives in the shooting may have been a dispute over child visitation and ongoing domestic violence between Minter and his girlfriend, police said in their statement.

CNN’s Tony Marco contributed to this report.