Bail has been denied for a man accused of stabbing a Cook County sheriff’s officer in the head on Monday evening when the officer tried to take him into custody in Bronzeville.

Sheriff’s officers were following up on information that 22-year-old Joevaun Brewer had been spotted near 41st and State streets when they saw him walking in the area just before 6:30 p.m., Cook County prosecutors said in court Wednesday.

Brewer was wanted on an escape warrant issued when the sheriff’s office learned that he was not at the home he was registered to electronic monitoring at on Nov. 6, prosecutors said.

When the first two responding officers approached Brewer and told him to show his hands, he initially refused and then drew a knife and swung it at one of the officers, Assistant State’s Attorney Rachel Mabbott said.

As the officer stumbled backward, he drew his gun and fired at Brewer, who had continued to move toward him, Mabbott said. The officer fell to the ground and his partner then also fired twice at Brewer, who was able to run off.

Joevaun Brewer | Chicago police

Three more sheriff’s officers responded to the gunfire and chased Brewer. They attempted to subdue him with Tasers, but neither of the two strikes they made had an effect, Mabbott said.

Near 41st Street and Michigan Avenue, one of the officers was able to tackle Brewer. Brewer then stabbed the officer in the head, causing a gash that required 12 stitches to close, Mabbott said.

Other officers managed to take Brewer into custody and they found a knife and a pair of scissors on the ground beside him, authorities said.

The dramatic scene unfolded just hours after and about two miles south of a shooting at Mercy Hospital that left a Chicago police officer, two hospital employees and the gunman dead.

Brewer was taken to a hospital for treatment of a gunshot wound to his elbow, Mabbott said. He was subsequently charged with attempted murder of a police officer, aggravated battery, assault and resisting arrest.

Brewer had been released on a personal recognizence bond and electronic monitoring in October after being charged with criminal damage to government property and manufacture or delivery of a controlled substance, according to court records.

Prosecutors said he also failed to show up at a hearing on Thursday for charges and arrest warrants were also issued on those matters.

Judge Sophia Atcherson ordered Brewer held without bail on the warrants and also denied him bail on the new charges.

His next court date was set for Dec. 10.