New York City Police Officers gather at a shooting scene in the Bronx borough or New York, Friday, Nov. 4, 2016. Authorities say two New York City police sergeants have been shot in a gun battle with a robbery suspect. A police spokesman says the robbery suspect was killed in the gun fire exchange. (AP Photo/Jennifer Peltz)

NEW YORK (AP) — A police sergeant was shot and killed and a second one was wounded Friday in a gunfight on a street with an armed man who had broken into his estranged wife’s home, officials said.

The gunman also was killed in the exchange of shots that took the life of Sgt. Paul Tuozzolo, a 19-year veteran of the New York Police Department and the father of two young children.

“The city is in mourning, and the family of the NYPD is in mourning,” Mayor Bill de Blasio said at a news conference held at a Bronx hospital.

The mayor called Tuozzolo “a very good man, a devoted man, a man who committed his life to protecting all of us.”

The other wounded sergeant, Emmanuel Kwo, was undergoing treatment for a gunshot wound to the leg, officials said.

The violent encounter began to unfold at 2:45 p.m., when a woman called police and said a Long Island man, Manuel Rosales, had forced his way into an apartment where his estranged wife and their 3-year-old son were staying. Rosales stayed for hours before fleeing, police said.

Patrol officers spotted his car just a few minutes later about a half-mile away. Several officers converged on the vehicle. As they approached, Rosales opened fire with a .45-caliber semi-automatic pistol, police said.

Tuozzolo was shot at close quarters, police Commissioner James O’Neill said.

“There’s nothing worse than a day like today,” O’Neill said.

News helicopter footage of the scene showed the red SUV that Rosales had been driving mounted on a sidewalk, pinned between a flatbed truck and a police vehicle.

Area resident Gary Mayo, a city worker, was home on a day off when he heard five or six booms.

“That doesn’t sound like firecrackers,” he said he thought.

From the terrace of his fourth-floor apartment he saw a swarm of police cars converging on a nearby street and could tell whatever happened was “something really big,” he said.

Rosales, 35, had a history of 17 arrests, many related to domestic disputes, and had served time in state prison for possession of stolen property.

A court issued an order in January 2015 telling him to stay away from his wife. In July, he was arrested in Bay Shore and was accused of violating that order by grabbing her hair and yanking her head back and forth.

He was scheduled to appear in court on Long Island on Nov. 16 on a charge of violating a protective order.

A lawyer who previously represented Rosales said he wasn’t violent but declined to comment further.

Tuozzolo is the fifth New York Police Department officer to be fatally shot in the line of duty in the last two years.

Gov. Andrew Cuomo, a Democrat, said in a statement that Tuozzolo had “made the ultimate sacrifice in the line of duty.”