Texas police say a man who attempted to rob a church in the Houston area ended up getting shot by a pistol-packing pastor.

Officials say that 27-year-old Lee Marvin Blue kicked in the door of the Church of New Beginnings in Baytown around 6:15 a.m. on Tuesday in a robbery attempt. However, the intruder awoke Pastor Benny Holmes, who had been sleeping in his office. Holmes says he caught the thief red-handed, holding a large box of electronics that he had taken from the church. Holmes said he told Lee to drop the items, but when the man refused to comply, he opened fire.

"I just want the public to know that this was a robbery," Pastor Holmes told Eyewitness News. "He broke in the door, had laptops in his hand. I commanded him to stop twice, and he didn't. So fearing for my life, I did what I had to do."

As a result, Lee was shot in his right shoulder.

However, once the suspect was down, Holmes said that he prayed with him.

"I led him through the sinner's prayer while he was on the floor," said the church leader. "He repeated the sinner's prayer after me. And that was about it."

Holmes added that he plans to visit Blue, who was taken by Life Flight to Memorial Hermann Hospital to be treated for non-life-threatening injuries, reports Chron.

He was charged with burglary of a building. However, this was not his first run in with the law. Blue has an extensive criminal that includes trespassing, car burglaries, assault and public intoxication.

The pastor's ex-wife said that Holmes, who is a Vietnam veteran, chose to sleep at the church as of late

"We're going to be praying for the victim but at the same time we're thankful that it wasn't the pastor," she said. "He loves the Lord. A man of God cares for his sheep and certainly protects the property."