San Diego police shot and killed a gunman who fatally wounded a police dog Wednesday in a confrontation at a community college campus, authorities said.

The 33-year-old man was pronounced dead at a hospital after the confrontation at San Diego Mesa College, according to a statement from San Diego County sheriff’s homicide Lt. Joseph Jarjura. His name wasn't immediately released.

Police were investigating a report that the driver of a white Tesla had shot at another driver at around 1:30 a.m., Jarjura said.

SAN DIEGO COUNTY OFFICIALS SAY 3-YEAR-OLD ACCIDENTALLY SHOT AND KILLED 1-YEAR-OLD SIBLING

The Tesla was being driven erratically and the other motorist heard a gunshot as he drove around the vehicle, according to Jarjura.

The Tesla then followed the motorist to a location where he parked and more shots were fired. The motorist wasn't struck but one bullet went into a nearby home, although nobody inside was injured, Jarjura said.

CA Fox News graphic

San Diego police fatally shot a man after he killed a police dog. The shootout occurred at San Diego Mesa College. (Fox News)

Officers searched the area and located the Tesla. They saw the suspect, a 33-year-old male, in the driver’s seat with a handgun in his hands. The driver refused to pull over, drove onto a campus parking lot and abandoned the car, Jarjura said.

DALLAS BOY, 7, DIES DAYS AFTER BEING SHOT WHILE SLEEPING IN BED FROM BULLET OUTSIDE HOME

Officers then saw the armed man nearby talking on a cellphone, he said.

The man ignored commands to drop the gun, which he had placed underneath an armpit, and began walking toward an open lot, Jarjura said.

The police dog was sent after him and the man drew his handgun, prompting an officer to fire a round from a rifle that struck him, Jarjura said.

The gunman also fired a bullet, which struck the dog.

CLICK HERE TO GET THE FOX NEWS APP

The dog, named Sir, was wounded and pronounced dead at a veterinary hospital. Sir was a 4½-year-old Belgian Malinois who had been with the Police Department since March 2022, authorities said.

"RIP Sir. You saved lives," said a posting from the San Diego Police Officers Association on X, formerly known as Twitter.