A Phoenix police sergeant shot a 26-year-old man Tuesday morning after the man repeatedly punched the sergeant in the head, officials said.

The sergeant was driving in an unmarked car after leaving a training facility when he saw a man walking northbound on Seventh Avenue from Dobbins Road, said Sgt. Trent Crump, a spokesman for the Phoenix Police Department.

The sergeant stopped his car and partially rolled down his window to ask the man why he was in the road and if he needed any help. The 26-year-old began making offensive comments directed at the sergeant and reached in the car and opened the passenger-side door, Crump said.

The man entered the sergeant's car and began striking him in the face, police said.

The sergeant fought back and reached for his gun. When the sergeant thought the attack was going to render him unconscious, he fired his gun, shooting the man once in the lower part of his chest, Crump said.

The attacker got out of the car and collapsed. He was taken to a hospital and was in serious but stable condition, Crump said.

The sergeant was taken to Banner Good Samaritan Medical Center for precautionary reasons. He was treated for facial wounds and other minor injuries and released, authorities said.

Before the incident with police, a woman called saying she saw the man running aimlessly through traffic, yelling at vehicles. The man approached her car and that's when she locked the doors and called police, Crump said.

The 26-year-old man is being booked on suspicion of felony charges upon release from the hospital, Crump said.

Police have not released the man's name at this time.