SAN JOSE — A 14-year veteran San Jose police officer was killed Tuesday evening in a dramatic series of events that began with a call about a suicidal man and turned into a massive manhunt for an armed 57-year-old suspect who police later said might still be holed up in his apartment.

The killing of Officer Michael Johnson was the department’s first line-of-duty death in 14 years.

Johnson was the 12th SJPD officer killed in the department’s 166-year history. He was a field training officer at the time of his death.

Johnson happened to be in the same police academy class as Jeffrey Fontana, the last officer killed in the line of duty. Fontana was in his rookie year on the force when he was shot to death during a high-risk vehicle stop in South San Jose on October 28, 2001.

A San Jose police officer was shot and killed after exchanging gunfire with a suspect Tuesday night.

Police identified the suspect in Johnson’s slaying late Tuesday as Scott Dunham, 57. San Jose police Chief Larry Esquivel said officials believed he was by himself within his apartment on Senter Road as of 11 p.m., but said investigators were chasing down the possibility that he might be elsewhere.

“As a chief this is not something we would ever want to do,” Esquivel said at a news conference late Tuesday. “It’s a sad day for law enforcement and for the police department and the community.”

Mayor Sam Liccardo, who added that he offered condolences to the slain officer’s family on behalf of the city, said, “This is San Jose’s darkest hour. This strikes the heart of all of us in San Jose and throughout the region.”

Liccardo said in a tweet that Johnson was engaged to be married.

Police launched a massive manhunt after the attack with a detail consisting of dozens of officers and the MERGE (SWAT) unit, who all swarmed the area of Senter and Umbarger roads to find the gunman.

Nearby homes were evacuated as officers and equipment — including armored vehicles and a helicopter — were summoned from neighboring police agencies, including the Santa Clara County Sheriff’s Office, Santa Clara and Sunnyvale police, and the California Highway Patrol.

Scott Dunham, 57, of San Jose, is being sought in connection with the shooting death of a San Jose police officer on Tuesday, March 24, 2015. (San Jose

Esquivel said investigators believe police have Dunham cornered in the apartment building in the 2600 block of Senter, and that he is alone.

“This investigation will continue until this person is apprehended,” Esquivel said.

San Jose officers were initially called at 6:48 p.m. by a family member who said that Dunham was intoxicated, despondent and possibly meant to harm himself or others, Esquivel said. As the officers approached the apartment building on Senter Road and spotted a person on a balcony, they were fired upon without warning.

Police dispatch recordings show that officers told dispatchers they believed the man they were searching for had one or two handguns in the apartment.

San Jose Mayor Sam Liccardo, center, speaks during a press conference regarding the San Jose police officer killed earlier in the day in San Jose, Calif.,

At one point, as they approach the apartment, an officer says “we have movement from the blinds at the apartment.”

An officer calmly reports that a male has stepped out onto the balcony, describing him as having gray hair, a gray mustache and a black T-shirt. Seconds later, the “shots fired” call can be heard, followed almost immediately by the “officer down” call.

Dispatchers immediately called for the area to be secured and put out a citywide call for assistance. Another officer reports that shots were fired at the man, and that he possibly “went down as well.” Esquivel confirmed the gunfire exchange and the possibility that Dunham was wounded.

“This person had the nerve, the audacity, to shoot at our officers who were on a call for assistance,” Esquivel said.

An outpouring of grief flowed from both members of the public and law enforcement agencies throughout California and across the nation Tuesday night. Hundreds of social media users sent their condolences to San Jose police through the department’s Twitter account.

“It’s extremely painful and shocking,” said Councilman Tam Nguyen, who represents District 7, where the shooting occurred. “I’m worried for the safety of other officers, he’s still at large and still very dangerous.”

Tam said he lived in the neighborhood and was not going home because of the manhunt, but driving around and waiting to hear more from police.

“I want to let them concentrate on their own safety and the safety of others,” he said.

Staff writer Eric Kurhi contributed to this report.