Church members wrestled the man to the ground before he could seriously hurt anyone else.
The shooting happened in Maryville, Ill., a community about 17 miles northeast of St. Louis during the 8 a.m. service at First Baptist Church.
Pastor Fred Winters was at the pulpit.
"An individual walked down the aisle and met the pastor, at which point he pulled out a gun and shot the pastor," said Illinois state police Trooper Ralph Timmons.
The gunman fired four shots before his weapon jammed. Illinois state police say the pastor deflected the first bullet with his Bible.
"It hit the very top of the Bible and exploded the top of the Bible into what many in the congregation thought was confetti. In fact, some thought it was some type of skit or some type of program at the time," said Larry Trent, director of the Illinois State Police.
But at least two church members realized what was happening and tackled the gunman as he pulled out a knife. All three were hurt in the struggle. The gunman and one church member underwent surgery at a St. Louis hospital. The other victim was treated for his injuries and released.
"I would call it heroic. While many people were, understandably, stuck to their seats if you will, they didn't and took quick action," Trent said.
As the scene unfolded, Claudia Bohley was waiting in the foyer for the next service.
"People were?down on their knees and on the floor. They were screaming and praying. Just a terrible thing, just terrible," she said.
The St. Louis Post-Dispatch reports that Pastor Winters was a married father of two children. Police say he had been with the church for 22 years.
"We were just talking about what a wonderful smile and how happy he always is. And we just sat down in the chair and 'pop, pop, pop.' We just couldn't imagine what had happened. And they ran out, '911, the pastor's down, been shot,'" said Bohley.
No one attending the service said they recognized the 27-year-old gunman. Police say they don't have a motive for the shooting, and they haven't determined if the gunman had some type of relationship with Winters or the church. Police will not identify the gunman until he is charged, but it is known that he was from the nearby community of Troy.
Authorities say they will review an audio tape of the church service to see if it holds any clues.
Members mourning the loss of their pastor gathered for a prayer service Sunday evening.
Governor Quinn issued a statement Sunday urging the community to come together to help those affected by the tragedy.