Police fired their weapons for the seventh and eighth time this year to stop two men who had aimed their guns on the officers in two separate incidents just 12 hours apart, the NYPD said Wednesday.

In the first incident, a man was in stable condition after being shot twice on a Manhattan street Tuesday night. In the other, a man was shot and killed Wednesday during a domestic dispute in an apartment in the Bronx, police said.

Wilvinson Diaz, 26, of 1952 First Ave., East Harlem, was shot about 8 p.m. Tuesday after he shot a man and then pointed his gun at NYPD plainclothes detectives in East Harlem, the NYPD said. One of the detectives shot Diaz in the leg and torso.

photosRecent NYC mug shotsDataNYC crime rates

Diaz was taken to Harlem Hospital Center, where he was arrested and charged Wednesday with attempted murder, criminal possession of a loaded firearm, criminal use of a firearm, reckless endangerment and unlawful possession of marijuana, the NYPD said.

Police said the two detectives, assigned to the NYPD Special Victims Unit, saw Diaz, armed with a .22-caliber pistol, run south past them on First Avenue toward a 21-year-old man, who had his back to Diaz. Diaz shot the man, who was taken to Metropolitan Hospital by private means and was in stable condition, police said.

The detectives followed Diaz and ordered him to drop his weapon. Instead, Diaz turned and pointed the gun at the detectives, one of whom fired twice and struck Diaz.

advertisement | advertise on newsday

On Wednesday morningmorning, police in the 46th Precinct shot and killed a man who was threatening a 19-year-old woman and the officers with a gun.

Officers arrived in the 2000 block of Valentine Avenue in the Bronx about 8 a.m. in response to a domestic dispute call, police said. The unidentified man retreated into a bedroom and locked the door, which the officers broke down. Police found the man holding the woman at gunpoint with a .38 caliber pistol.

The man attempted to shoot the woman but the gun misfired three times, the NYPD said. The man then pointed his gun at the officers, who fired multiple times and killed him, police said.

NYPD Commissioner William Bratton said the officers had acted in an "exceptional manner" and helped to save the young woman's life.

She was taken to St. Barnabas Hospital to be treated for a graze wound and bruises to her face.

@Newsday

With Anthony M. DeStefano, John Valenti and Candice Ruud