NEW YORK (CBSNewYork) – Weeks before two police officers were gunned down in Brooklyn, Mayor Bill de Blasio’s wife wrote an essay on how tough the job of a police officer is.

Chirlane McCray penned the essay in early December for a commemorative “Black Lives Matter” issue of Essence Magazine.

READ MORE: Amazon Web Services Outage Spells Trouble For MTA App Users, Among Others

McCray wrote the essay in December, prior to the ambush killings of officers Wenjian Liu and Rafael Ramos.

The essay appears as de Blasio remains embroiled in a tense back-and-forth with police unions, who have said he has blood on his hands.

In the essay, McCray praised a group of grandmothers that routinely meets with members of the clergy and the NYPD as an example of how to improve the relationship between the community and the NYPD.

“This, I thought, is community policing in action, an organic alliance between police and a community in urgent need of protection,” McCray wrote. “But then, less than a month later, Eric Garner was killed in an encounter with NYPD officers. And I mourned the step backwards as the community reflected on the death of yet another unarmed black man. Like many, I wondered, what will it take to build a relationship of trust between communities of color and the police who serve them?”

“I think we must acknowledge that being a police officer is a tough, tough job. In the face of real physical anger, the officers are required to maintain their professionalism and composure,” McCray wrote. “They have to sort out the so-called bad guys from good guys, without resorting to stereotype. And they must do all of this while respecting the dignity of everyone they serve.”

READ MORE: 'West Side Story' Returns To Paterson For Special Screening

McCray added that the killings of Liu and Ramos left the city “shaken to the core,” adding “New Yorkers will work even more to strengthen the alliance between our police force and our communities.”

McCray touted reforms being implemented by de Blasio, including an end to the overuse of stop and frisk and making an adjustment to arrests for possession of marijuana.

You can read the complete essay here.

You may also be interested in these stories: 

[display-posts category=”news” wrapper=”ul” posts_per_page=”4″]

MORE NEWS: Police: Burglar Steals From Brooklyn Synagogue 3 Times