The New York City Police Department is mourning the loss of a 12-year veteran who was shot in the Bronx early Wednesday morning in what investigators are calling an unprovoked attack.

Investigators say 48-year-old Miosotis Familia was sitting in a mobile command unit with her partner when 34-year-old John Bonds, who also goes by the name Alexander, walked up to her window and opened fire, striking Familia in the face.

It happened around 12:30 a.m. near the corner of East 183rd Street and Morris Avenue in Fordham Heights.

"It was fireworks going on until around five in the morning," one man in the area recalled. "You didn't know what was a gunshot or not."

Sources said Bonds was seen in a nearby bodega moments before the shooting and had pulled a hoodie over his head as he left the store.

Familia was rushed to St. Barnabas Hospital, where she died of her injuries.

Police say responding officers shot and killed Bonds at the scene.

“An Anti-Crime team consisting of a sergeant and police officer who were in uniform encountered a male subject running on Morris Avenue, approximately one block from the scene of the shooting. As they confronted him, he drew a revolver. The officers fired at him, striking and killing him," said Police Commissioner James O'Neill. "Based on what we know, it's clear this was an unprovoked attack on police officers who were assigned to keep this great city safe."

A 38-caliber revolver was recovered at the scene.

Records show Bonds had been on parole since 2013 for a robbery in Syracuse, N.Y.

He also had other prior arrests, including one in 2001, when he was accused of attacking an officer with brass knuckles.

While there does not appear to be a clear motive, the Associated Press is reporting investigators are looking into a video he posted on Facebook in September.

In it, he rants about the treatment of civilians by officers and talked about how hard life was behind bars.

"Don't think every brother, cousin, uncle you got that get killed in jail is because of a Blood or Crip or Latin King killing them. Nah, police be killing them and saying that an inmate killed them,'' he said in the video. 

At another point, he said into the camera: "I'm not playing, Mr. Officer. I don't care about 100 police watching this.'' And: "It's time for people to rise up.''

A bystander was also struck by a bullet in Wednesday morning's incident but suffered non-life-threatening injuries.

Miosotis Familia worked in the 46th Precinct and was a 12-year veteran of the NYPD. She was part of an anti-crime unit that set up in the neighborhood in March after an uptick in gang activity.

She is the sixth NYPD officer since 2014 to be killed while on duty.

Familia leaves behind three children.

Mayor Bill de Blasio has ordered flags at City Hall be lowered to half staff in honor of Familia.

In a statement, Gov. Andrew Cuomo said in part, "Law enforcement officers across New York put their lives on the line to protect and serve their communities. This horrific and senseless assassination is a devastating reminder of the risks these brave men and women face each day."

De Blasio and O'Neill visited the 46th Precinct station house Wednesday to offer condolences to the men and women in blue.

Outside, officers gathered in prayer. "Bless these officers, give them the strength today, Lord," said the officer leading the prayer.

Police lined up in formation as Familia's body was brought from the hospital later in the day Wednesday.

At the station house, they hung black and purple bunting as a makeshift memorial continued to grow.

All police cruisers are being outfitted with bulletproof glass to prevent the kind of ambush that killed Familia, but mobile command vans do not have such protections.

Family members, clergy, and local leaders urged the community to support the NYPD at a vigil for Familia on Wednesday night.

They remembered her not only as an officer, but as a mother, sister, and friend. Her fellow officers said she did not deserve to die.

"One of the most beautiful officers that I've ever met in my life," one officer said about Familia. "In everything, in every way."

"Dedicated, good-natured, good person, anything would drop it on a…just to help anyone," another officer said. "Even though she had children, she never had a problem with staying behind to help someone else."