Attorney General Jeff Sessions paid tribute Wednesday to fallen New York City police officer Miosotis Familia, while condemning the "cowardly, unprovoked attack" as a “murder in cold blood.”

Officer Miosotis Familia was shot to death early Wednesday, ambushed inside a mobile command post by an ex-convict who had ranted online about his treatment in prison and about officers getting away with killing people, authorities said.

The gunman was killed by police about a block away.

The 48-year-old Familia was writing in her notebook in the front seat of the RV-like vehicle when the killer strode up to it in a Bronx neighborhood around 12:30 a.m. and fired one round through the passenger-side window, striking her in the head, authorities said.

“Officer Miosotis Familia proudly wore the badge for 12 years, serving her community and keeping the people of New York City safe,” Session said in a statement.

“She was doing her duty … unjustly targeted and murdered in a cowardly, unprovoked attack,” he said. “This murder in cold blood is a tragedy. And sadly it is the latest in a troubling series of attacks on police officers over the past two years. These attacks must stop and we must honor the service of every law enforcement officer and the memory of those we have lost in the line of duty.”

The Associated Press contributed to this report.