A gunman who opened fire and killed two people at a Kentucky Kroger’s earlier this week tried to get inside a predominantly black church, police said Thursday.

Gregory Bush, a 51-year-old white man with a history of violence and mental illness, “appeared to try to gain access” to First Baptist Church in Jeffersontown before shooting and killing two African-Americans at the grocery store, police chief Sam Rogers said.

Authorities received a tip from a city of Jeffersontown employee who said he thought he saw Bush outside the church. Video confirmed Bush’s presence around the church, which is headed by a black pastor and has a large African-American membership, Rogers said.

Billy Williams, the church administrator, told The New York Times between eight and 10 people were inside the church when Bush arrived. A church member said they saw Bush tug on the door and then drove away after 10 minutes.

Gregory Bush is arraigned on two counts of murder and 10 counts of wanton endangerment Thursday, Oct. 25, 2018, in Louisville, Ky. (Scott Utterback /Courier Journal via AP, Pool)

News of Bush’s alleged presence around the church came as multiple reports said Bush made a racial comment after the deadly shootings. Rogers said, however, it was too soon to determine whether the shooting was racially motivated.

“I can't speculate on motive at this time,” he said. “We are pursuing all avenues of the investigation no matter where that takes us or what it involves.”

Bush walked into the grocery store, pulled a gun from his waistband and shot a man in the back of the head and kept shooting him multiple times “as he was down on the floor,” according to an arrest report. Bush then holstered his gun, walked outside and killed a woman in the parking lot, the report said.

KROGER GROCERY STORE SHOOTING LEAVES AT LEAST 2 DEAD: POLICE

A man with a concealed weapon then confronted Bush in the parking lot, but the suspect “began firing wildly” putting other people in danger, Rogers said. No one was hurt in that confrontation, Rogers said.

The shooting victims were identified as Maurice Stallard, 69, and Vicki Lee Jones, 67, the coroner’s office said. Police said they both died of gunshot wounds. Police said there didn’t appear to be a connection between Bush and the victims.

Louisville Mayor Greg Fischer shared his outrage over the shooting, calling it an “epidemic of gun violence” that “hit close to home.”

Subscribe to Fox News First -- your briefing on all the stories to start the day

“People getting shot at a grocery store, a school, outside a church. Can't we all agree that that is unacceptable?” he said.

Authorities removed computers and cellphones from the house where Bush lived with his parents.

His criminal record showed he threatened his ex-wife and punched a deputy sheriff during a family court hearing a few years ago. He was also charged with assaulting his elderly parents in January 2009.

The Associated Press contributed to this report.