A serial criminal who shot dead a female NYPD cop in a cold-blooded ambush early Wednesday morning had previously posted vulgar anti-police rants on Facebook Live.

Officer Miosotis Familia, 48, was sitting in her marked vehicle when 34-year-old Alexander Bonds shot at her through the passenger side window near the intersection of 183rd Street and Grand Concourse in the Bronx.

Familia, a 12-year veteran of the force and mother of three, later died after being rushed to hospital for surgery.

Bonds was shot dead by other officers as he fled the scene.

Alexander Bonds, 34 (left), shot and killed NYPD officer Miosotis Familia, 48 (right), early Wednesday morning. He was later shot dead by other officers

A female NYPD officer was shot dead while sitting in a department vehicle (left) early Wednesday morning

Above, a close up view of the command trailer's shattered window after the early morning attack

He had a history of criminal convictions and made his hatred for police clear in anti-cop messages posted on social media.

In a Facebook Live video in September, Bonds ranted about law officers killing and abusing people and warned them to leave him alone or 'we gonna do something.'

'Police is f****ts, and this ain't no gimmick,' he said in the video.

'Don't think every brother, cousin or uncle you got that get (unintelligible) in jail is because of a Blood or Crip,' he said. 'Police be killing and saying an inmate killed them.'

N****s ain't taking it no more, Mr Officer. I'm here to tell you man. ... just keep your a** away from mine.'

The rant came months before Bonds ambushed officer Familia and killed her on Wednesday.

An innocent bystander was reportedly also shot in the stomach and is now in stable condition.

Officer Miosotis Familia, 48, has been identified as the victim. She died at the hospital. Above, emergency personnel stand near the scene of the shooting Wednesday morning

The suspect, 34-year-old Alexander Bonds, was shot dead by other officers after he was caught fleeing the scene. Above is the gun that was recovered at the scene after the deadly shooting

Officer Miosotis Familia was memorialized before the start of a baseball game between the New York Yankees and the Toronto Blue Jays on Wednesday

An officer helped escort a crying woman into Familia's apartment building in the Bronx on Wednesday

Bonds' criminal record included a 2001 arrest for beating up another NYPD officer with brass knuckles. Four others reportedly joined in assaulting the officer. The outcome of that case is not known.

Bonds was currently on parole for a 2014 robbery in Syracuse. He also had prior arrests for drug violations in 2000 and 2002. He is said to have had addresses all over the city, in the Bronx, Queens and several homeless shelters, and went by up to six different aliases.

New York City Police Commissioner James O'Neill said Familia was 'assassinated in an unprovoked attack on cops.'

The officer was in a command vehicle with her partner when the shooting occurred.

Familia's partner frantically radioed for help.

'Shots fired!' a panicked officer was heard shouting into his police radio just after shots rang out.

'I need a f*****g bus! 10-85 10-85! My partner's shot! My partner's shot! My partner's shot! Hurry up central!'

Police Commissioner James O'Neill (left) said that the attack was unprovoked. New York Mayor Bill De Blasio (right) also spoke at the press conference early Wednesday morning

Bonds' (pictured) criminal record included a 2001 arrest for beating up another NYPD officer with brass knuckles. Four others reportedly joined in assaulting the office

Bonds (pictured left and right) was currently on parole for a 2014 robbery in Syracuse

Officers caught up with Bonds about a block away and killed him when he pulled a revolver. A silver revolver was recovered from the scene, police said.

The burst of gunfire as the Fourth of July wound down was initially mistaken by some for fireworks.

Familia was a 12-year veteran of the force who spent her entire career with the department in the high-crime Bronx precinct. The command post there had been set up and staffed around the clock since a triple shooting in March.

'She was on duty serving this city, protecting people, doing what she believed in and doing the job she loved,' Mayor Bill de Blasio said.

She had three children, including a set of twins, lived with her mother and worked the midnight shift.

Friends said she became an officer to help her community, and her family was heartbroken.

'Put it this way: She'd give you the shirt off her back. She was the sweetest person you ever want to meet,' downstairs neighbor Tom Ritter said. He said his son, now 22, played with Familia's children, and she practically 'adopted' him.

Even a woman who said her husband had been arrested by Familia had only kind words for the slain officer.

'She gave me good advice, like a mother to a daughter,' said Keisha Williams, 31, who said her husband was arrested on a marijuana charge. 'She's good, but she's a tough cookie. She's a good cop. I'm just sad it was her.'

The New York Fire Department received reports at about 12:30am of an officer who was shot near the intersection of 183rd Street and Grand Concourse in the Bronx (seen above)

A police officer from the local 46th Precinct in the Bronx was shot sometime after midnight on Wednesday

Armed NYPD officers are seen above at the scene of the shooting

A large contingent of officers is seen at the intersection where the shooting took place early Wednesday morning

The NYPD also deployed an emergency service unit vehicle in the immediate aftermath of the shooting

Police said they were trying to establish the motive for the shooting.

While tensions have been running high in recent years between police and black people around the country, there was no immediate indication the killing had a racial or ethnic dimension.

Bonds was black; Familia was black and Hispanic, her family having come from the Dominican Republic. She apparently had no previous contact with him.

Bonds was caught on video leaving a convenience store, then moving tightly along the wall, pulling a hoodie over his head and walking purposefully toward the command post vehicle with gloved hands.

The video didn't capture the shooting itself but showed him running away with a gun in his hand, police said.

While all the department's new patrol cars are outfitted with bullet-resistant windows, the rolling command posts don't have them.

The attack recalled the 2014 ambush killings of two New York City officers who were gunned down in their marked car in Bedford-Stuyvesant, Brooklyn.

They were killed by a man who had announced online moments before that he was planning to shoot two 'pigs' in retaliation for the police chokehold death of Eric Garner in New York. The gunman, 28-year-old Ismaaiyl Brinsley, then killed himself.

Police at the scene put up yellow time demarcating the area where the shooting took place

The attack may have been an assassination and the gunman had posted anti-cop message sin social media, police sources told the New York Post

The shooting was remniscent of the December 2014 double shooting of two officers in Bedford-Steyvesant, Brooklyn. Above, a look at the Wednesday crime scene