A St. Paul man was charged Monday with second-degree attempted murder for shooting at police officers who were attempting to search his home.

Cory A. Lee, 37, was also charged in Ramsey County District Court with possession of a firearm by an ineligible person. St. Paul police were executing a warrant at his home in the 600 block of Maryland Av. E. on Friday when he allegedly fired a shot at police. Officers were not hurt, but one officer’s tactical vest had a hole consistent with a bullet, charges said.

According to the complaint: Lee was wanted in connection with a shooting that occurred on March 18. Police announced themselves and then used a battering ram to break open a door that allowed them into a common entryway with doors to Lee’s lower unit and the building’s other unit.

The complaint said an officer Moore (whose first name was not given) tried Lee’s door, but it was locked. Moore announced, “Police! Search warrant! Police! Search warrant!” Moore rammed the door three to five times, breaking it open, the complaint said.

Moore said he saw Lee in a combat stance about 10 yards down a hallway, both hands up holding a silver or chrome handgun, according to charges. Lee looked at Moore and fired a shot.

Moore, who was holding the ram with both hands, did not have a firearm ready. The complaint said an officer named DeGree (no first name given) heard the shot and saw a muzzle flash when the door was forced open. DeGree also saw Lee holding a gun, the complaint said. DeGree fired his rifle at Lee.

Officers retreated after the gunfire. Lee announced he had a wound, and was instructed to crawl toward the door. He was transported to the hospital for a gunshot wound to his left biceps. Moore’s tactical vest sustained damage consistent with a bullet hole, the charges said.

Lee told authorities he had a gun because he was robbed a few weeks prior, the charges said. Lee’s daughters were home when the search warrant was executed.

“I was just looking at the door and when I saw the door open, I just fired,” Lee said, according to charges. “I thought they were coming in to kill me.”

Lee’s neighbor told police that Lee sold marijuana and had been robbed recently at home by a few men.

Lee was charged Friday with second-degree assault and possession of a firearm by an ineligible person for a shooting allegedly linked to the robbery. He fired at a car on March 18 at Edgerton Street and Maryland Av. E., according to the complaint.

The victim of that shooting told police that he purchased marijuana from Lee and introduced a new customer to Lee. The victim told police that the new customer later stole marijuana from Lee.

Lee was convicted of attempted criminal sexual conduct in Cook County, Ill., making him ineligible to possess a gun.