This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

A man died from a self-inflicted gunshot wound after engaging in a gunbattle with deputies in the parking lot of the Temple City sheriff’s station, where he had gone to register as a sex offender Monday morning, authorities said.

Deputies approach a vehicle after shots were fired at the Temple City Sheriff’s Station on March 20, 2017. (Credit: KTLA)

The man, identified only as a 47-year-old white male, entered the station located in the 8800 block of East Las Tunas Drive about 7:25 a.m. to register as a sex offender, Los Angeles County Sheriff’s Department Lt. Joe Mendoza said.

The deputy at the counter inside the station realized that the man had a $40,000 warrant for his arrest in connection with a felony sex crime that occurred in the city of Los Angeles, Mendoza said. When the deputy went further inside the station and returned with other deputies in order to arrest him, the man ran toward his vehicle, the lieutenant said.

Deputies followed him into the parking lot, where the man fired upon them, leading to an exchange of gunfire, Sheriff Jim McDonnell said at a morning news conference. A sheriff’s news release stated the man ran from the deputies, entered the rear passenger door of his vehicle and then armed himself with a shotgun.

The deputies, who were not struck in the incident, returned fire, sheriff’s homicide Capt. Steven Katz said. At one point, a team of deputies approached the dark blue SUV with guns drawn to get a view inside the vehicle, aerial video from Sky5 showed.

SWAT team members approach the SUV from which a man fired on deputies at the Temple City station on March 20, 2017. (Credit: KTLA)

A SWAT team was at the scene by 7:45 a.m. and two armored vehicles entered the parking lot. Authorities fired a flash-bang device at the SUV, but there appeared to be no movement from inside.

A short time later, authorities walked up to the vehicle behind an armored shield and opened a passenger-side door. By about 8:30 a.m., the man was pronounced dead.

Katz said he was killed by what appeared to be a self-inflicted gunshot wound, but the news release later said it wasn’t clear if the self-inflicted gunshot or deputy gunfire were fatal.

A shotgun was found inside the SUV and investigators believe a handgun was also in the vehicle, the captain said. The man’s body had a SWAT team vest partially on it, and it’s not clear how or where he got the vest, Mendoza said.

Later in the day, a SWAT team could be seen raiding a San Gabriel home connected to the man whose name the SUV was registered to. The Sheriff’s Department said it was not releasing his name.

Authorities remarked on the shootout as an example of the dangers that deputies face daily.

It remains unclear what led the man to open fire, but McDonnell said it was a concerning trend.

“We see these all too frequently now. This is the third officer-involved shooting this morning in the area. Certainly a great cause of concern,” McDonnell said. “We’re very, very fortunate and we’re very, very thankful that no deputies were injured or killed this morning because it could have been a very different day.”

The sheriff’s homicide bureau, headed by Katz, is leading the investigation.