The attack happened Friday night in the 7700-block of South Crandon in Chicago.
The officer does not want to be identified. He was off duty at the time, and an off-duty female officer went with him to look at the car. He says a man came out from behind a tree and began beating him with a baseball bat. The officer says another man had a gun pointed at the female officer's head.
The male officer says he told the attackers who he was then shot the men. He says his biggest concern was the female officer.
"Just to see a pistol to her head, knowing that's someone I work with everyday. It was just shocking to me. I'm not going to be able to explain to her mother or her father why she didn't come back home with me," the officer told ABC7 Chicago over the telephone.
"I think it's amazing that you're getting beaten with a baseball bat, you got a gun pointed to another officer's head, and you were able to squeeze off some rounds and strike all three offenders, and all three offenders were taken into custody," said Deputy Chief Tony DeBois.
ABC7 Chicago is told both officers will be okay. One of the attackers was seriously hurt.