Moments before a police-issued semiautomatic slug fatally ripped through Soto's chest, he allegedly pulled his .38-caliber Smith & Wesson revolver on Alvarez, a small-time hood who was getting the better of him in a fistfight, sources said.

Alvarez lunged for the weapon, and it went off twice during the struggle, attracting the attention of officers nearby, witnesses told police.

Alvarez, 23, then allegedly fired at Patrolman Douglas Brightman -- prompting the uniformed cop and three officers on the other side of the block to return a volley of 46 rounds, police said.

Soto, who was 22 and had eight previous arrests, was shot five times.

The bullet that killed him was the same caliber used by cops, according to Ellen Borakove, spokeswoman for the Office of the Chief Medical Examiner.

Plainclothes Officer Michael Tedeschi, 36, was struck in the chest by one of Brightman's two shots, but was saved by his Kevlar vest, authorities said.

Amazingly, Alvarez survived his 21 bullet wounds.

Another cop suffered a graze wound to his hand, and three bystanders also were shot. None of their injuries was life-threatening.

The Manhattan District Attorney's Office is investigating.

As he lay in his bed at Harlem Hospital with a breathing tube, Alvarez answered questions by nodding "yes" or "no," said his lawyer, John Carney, who has since been replaced by another attorney.

"I asked him if he had a gun. He [indicated] no. I asked him if he fired any shots. He indicated no," Carney said, adding that Alvarez pantomimed that Soto had pulled the gun from his waistband.

"He's been conscious, and he survived more gunshot wounds than probably anyone in the history of America," Carney said of Alvarez, who has not been charged.

He said police failed to swab Alvarez's hands for possible gunpowder residue after the shooting, which he predicted would have provided "exonerating" evidence for his client, who previously served two years in prison for weapons possession while allegedly trying to run over a cop.

Carney added that there was a witness, photographer Jaffar Toomes, who insists that police fired unprovoked on Alvarez.

Last night, Alvarez's new lawyer, Matthew Galluzzo, refused to comment other than to say his client "is alive.