San Antonio police fatally shot a 13-year-old boy who allegedly intentionally crashed a stolen car into a patrol vehicle early Friday morning, authorities said.

Officers were responding to gunfire near 5100 War Cloud Street shortly after 1 a.m. when they spotted a red car that matched the description of a vehicle involved in the shooting, police said.

When the car’s driver spotted a police vehicle in front of him, he threw it into reverse and struck another patrol car behind him, police Capt. Jesse Salame told NBC News.

“He reverses and tries to go back in the other direction. He doesn’t know that there’s a police car that is behind him,” Salame said. “And when he sees the other police car behind him, it looks like he veers in and crashes into that (police) car purposely on the driver’s side.”

An officer from that first patrol car then fired once into that fleeing vehicle, killing the 13-year-old driver, police said.

“He thought the other officer was going to be struck (again),” Salame said.

The driver was fatally wounded with the single shot and it wasn’t immediately clear if he had a gun, Salame added.

The boy was treated by paramedics at the scene and taken to a nearby hospital where he died, according to a statement by police Sgt. Washington Moscoso.

No officers were injured in the deadly confrontation and two other juvenile boys, riding with the 13-year-old, were taken into custody, officials said.