He added: “I got broken ribs for a reason, son, we gonna shake. We gonna do something. We can’t be dying for free, getting raped for free, just for them to give you hush money. Is you stupid? I don’t want the money. I want justice.”
At another point, Mr. Bonds alluded to encountering officers and said, “I’m not hesitating. It ain’t happening. I wasn’t a bitch in jail, and I’m not going to be a bitch in these streets.”
A law enforcement official said detectives have reviewed the Facebook video.
By midday Wednesday a picture had emerged of Mr. Bonds as an itinerant, hardened by repeated arrests and long stints in state prison. Other residents of the Morrisania neighborhood said they often saw him hanging out with a group of men outside and speaking with people who had come to buy drugs.
Mr. Bonds, who also went by the name John Bonds, was convicted in 2004 of criminal sale of a controlled substance near a school, a felony, state prison records indicate. He entered the state prison system in March of that year and was paroled seven months later.
He was arrested in January 2001 in New York City, accused of kicking an officer and punching the officer with brass knuckles, a law enforcement official said. The arrest record appeared to be sealed and further information about how the case was resolved was not available.
He was also arrested in 2000, accused of possession of marijuana, and had several arrests starting in 2001 on suspicion of selling a controlled substance to an undercover officer, the official said.
The Onondaga County district attorney, William J. Fitzpatrick, whose office prosecuted Mr. Bonds for the robbery in Syracuse, said Mr. Bonds and a teenager robbed someone in 2005 using a handgun, then fled before being arrested.
The attack early Wednesday occurred at the close of Fourth of July celebrations. Several witnesses said they had been setting off fireworks when the police suddenly swarmed the area. It revived memories of ambush-style killings of police officers, including in Brooklyn in 2014 and in Iowa last year.
Officer Familia, who was in uniform, had been sitting in a mobile command unit — a police truck that is big enough to house equipment and several officers — on the south side of East 183rd Street, near Creston Avenue, in the Fordham Heights neighborhood.
Around 12:30 a.m., as Officer Familia approached the end of her shift, Mr. Bonds walked up to the vehicle and fired one round from a .38-caliber, five-shot Ruger revolver through a passenger-side window, according to Deputy Chief Jason Wilcox, the commander of detectives in the Bronx.
Officer Familia’s partner, Vincent Maher, called for help, and two other officers encountered the suspect, who was running on Morris Avenue, about a block away. When the gunman drew a silver revolver, they opened fire, killing him.
A bystander was struck by a bullet in that encounter, and is in stable condition, said James P. O’Neill, the police commissioner.
“Based on what we know right now, this was an unprovoked attack against police officers who want to keep this great city safe,” Commissioner O’Neill said at a news conference at the hospital, where Officer Familia was pronounced dead at 3:37 a.m. Outside, a line of officers saluted her. Some escorted her body to the medical examiner’s office.
Mayor Bill de Blasio, speaking at the same news conference, praised Officer Familia and expressed the city’s grief.
“She was on duty, serving this city, protecting people, doing what she believed in and doing the job she loved,” he said. “And after this shocking and sudden attack, her fellow officers came to her aid immediately.”
A friend of Mr. Bonds, Elaine Lucas, said in an interview on Wednesday that she had never heard him voice anti-police sentiment.
“He was a sweetheart,” she said. “A little hardheaded, but a sweetheart.”
She said he had been in and out of homeless shelters and that she had never known him to be violent.
Officer Familia has been on the police force 12 years and was assigned to a plainclothes street crime unit of the 46th Precinct.
Chief Wilcox, asked whether the attack could be characterized as an assassination, replied, “Everything is pointing to that.”
At one point, Mr. Bonds lived at a homeless shelter on East 53rd Street in Manhattan, but he lived more recently in the Bronx. A police spokesman said there was no indication that Mr. Bonds had known Officer Familia.
A police vehicle sat in front of Mr. Bonds’s apartment building, on the Rev. James A. Polite Avenue, on Wednesday morning.
A neighbor, Marta Perez, 29, a homemaker and mother, said Mr. Bonds had moved into a second-floor apartment with his girlfriend about five months ago. Police officers flooded the block around 3 a.m., she said, and took his girlfriend in for questioning.
“He didn’t talk,” Ms. Perez said. “I saw him when he did food shopping with his girl. He was funny, strange funny — the way he looked at us. He played Spanish music all the time, but when he came outside he was funny-acting. Anytime he walked upstairs he wouldn’t say ‘Excuse me.’”
Witnesses in Fordham Heights said the violence had brought an abrupt end to what had been a leisurely holiday evening, with dancing and fireworks.
“At first I thought they were fireworks,” Roma Martinez, a longtime resident who was nearby when he heard gunfire. “I don’t know how many gunshots.”
He added: “Within two or three minutes, the streets were completely filled with officers. After, we all left. The party was over.”
Mr. Martinez said the neighborhood suffered from drug and gun violence. He said that he did not know Officer Familia, but that she had a reputation as “a good police woman.”
Joshua Lopez, 17, a Harlem resident who was with friends when the attack occurred, recalled: “We were shooting fireworks, chilling, and then we saw the cops come.” Amid the noise, he said, they did not hear the gunshots. But then they saw dozens of police cars, he said, driving toward the scene.
Rondo Round, 22, said he had been kept waiting by the police, who wanted him to give a statement. “I’m tired,” he said. “I want to go home. They think I saw everything. But I didn’t see nothing. I wasn’t out here by that time. After fireworks, I went to go eat, and that’s all I know.”
Mr. Round, who lives in the neighborhood, added: “This hood is not bad. We’re good people out here, just chilling and celebrating with fireworks. Yesterday was supposed to just be a holiday and a celebration.”
Mr. Round, who said he had recently spent time in prison on an attempted-murder charge, said that many residents distrusted the police. “The cop is just another regular human but they — the cops — don’t come out like this for regular humans,” he said.
The shooting was chillingly reminiscent of an ambush on Dec. 20, 2014, when two officers — Wenjian Liu and Rafael L. Ramos — sitting in a patrol car in the Bedford-Stuyvesant section of Brooklyn were fatally shot at point-blank range by a man who had traveled to the city from Baltimore vowing to kill officers. The man, Ismaaiyl Brinsley, who had a history of mental illness, then killed himself with the same gun.
Deadly attacks on the police received new attention when two officers were shot and killed in Des Moines and Urbandale, adjacent cities in Iowa, by a man who had ambushed them in separate attacks while they sat in their patrol cars on Nov. 2. The gunman was sentenced to life in prison.
The most recent New York City police officer to be killed at the scene of a violent confrontation was Sgt. Paul J. Tuozzolo, who, along with colleagues, confronted a suspect who had held his estranged wife and relatives hostage. That killing, on Nov. 4, also occurred in the Bronx — about two miles from the site of the shooting on Wednesday.
Patrick J. Lynch, the head of the Patrolmen’s Benevolent Association, the labor union for the city’s police officers, expressed outrage after the shooting of Officer Familia.
“This kind of violence against police officers cannot stand,” he said. “We need the public’s help. When you see someone that’s making threats, doing something against police officers, you need to let us know. You need to be our eyes and ears.”