A San Antonio police officer writing out a traffic ticket to a motorist was shot to death in his squad car Sunday outside police headquarters by another driver who pulled up from behind, authorities said.

San Antonio police Chief William McManus identified the officer as Detective Benjamin Marconi, 50, a 20-year veteran of the force.

At a news conference Monday, McManus said he believes "the uniform was the target."

McManus said the suspect had not been apprehended Sunday night. He said he doesn't believe the man has any relationship to the original motorist who was pulled over, and no motive has been identified.

"We consider this suspect to be extremely dangerous and a clear threat to law enforcement officers and the public," said McManus, who added that after the shooting officers had been instructed to not make traffic stops alone.

McManus said Marconi had pulled over a vehicle and while he was inside his squad car writing a ticket, a car pulled up behind him. The driver of that car got out, walked up to the officer's driver-side window and shot Marconi twice in the head, then walked back to his car and drove away.

Marconi was pronounced dead at a hospital.

McManus said investigators are looking into all leads and motives, including whether it could be related to an officer-involved shooting earlier Sunday in the city. In that incident, McManus said, police fatally shot a man who pointed a gun at officers outside an apartment following a seven-hour standoff.

"Hopefully, we'll solve this one real quick," McManus said.

Some streets downtown were blocked off with police tape as officials investigated the slaying.

The shooting came less than five months after a gunman killed five officers in Dallas who were working a protest about the fatal police shootings of black men in Minnesota and Louisiana. It was the deadliest day for American law enforcement since Sept. 11, 2001.

Ten days after the Dallas attack, a man wearing a ski mask and armed with two rifles and a pistol killed three officers near a gas station and convenience store in Baton Rouge, Louisiana. And earlier this month, two Des Moines, Iowa-area police officers were fatally shot in separate ambush-style attacks while sitting in their patrol cars.

"It's always difficult, especially in this this day and age, where police are being targeted across the country," McManus said.

Texas Gov. Greg Abbott called the slaying a "horrific act of violence." Abbott said in a statement that "attacks against law enforcement officers will not be tolerated in Texas and must be met with swift justice."

San Antonio Mayor Ivy Taylor extended condolences to the family of the slain officer and the entire police force.

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.