NYPD Commisioner Bill Bratton, Mayor Bill de Blasio, Chirlane McCray and Archbishop Cardinal Timothy Dolan leave St. Patrick's Cathedral on Sunday, the morning after two NYPD officers were shot and killed by a gunman in Bed-Stuy. View Full Caption DNAinfo/Eddie Small

MIDTOWN — New York Archbishop Cardinal Timothy Dolan called for calm and unity across the city at a Mass in St. Patrick's Cathedral Sunday morning as emotions ran high in the wake of the fatal shooting of two police officers in Bed-Stuy.

“We pray for our city. Might unity and calm, reason and civility, prevail as it has for us so often in the past,” said Dolan, who described the killings as a "brutal and irrational execution."

Toward the end of the homily, the cardinal spoke directly to NYPD Commissioner Bill Bratton, who sat next to Mayor Bill de Blasio and NYPD Chief James O'Neill at the service, and offered his support.

“Would you tell your officers that God's people gathered at St. Patrick's Cathedral this morning, thundered with prayer with and for them,” Dolan said.

► Man Who Killed NYPD Officers Told Bystanders: 'Watch What I'm Going to Do'

► Protesters Soften Tone and Hold Candlelight Vigil After NYPD Deaths

► Officers Killed in Bed-Stuy Mourned Across the City

► 'Blood on the Hands' of Mayor in Officers' Deaths, Police Union Boss Says

Officers Wenjian Liu, 32, and Rafael Ramos, 40, were gunned down Ismaaiyl Brinsley, 28, as they sat in their patrol car at Myrtle and Tompkins avenues Saturday afternoon. Brinsley, who claimed on social media to be avenging the deaths of Eric Garner and Michael Brown at the hands of police, then fled to the Myrtle Street G subway station, where police said he shot himself.

Dolan invited people to pray for the two dead officers, as well as all NYPD officers and the city’s leaders.

“Here we are anticipating the joy of Christmas, and we feel like we’re nearer to Good Friday," he said.

“We love them very much, we mourn with them, we need them, we respect them, and we're proud of them and we thank them."

De Blasio and Bratton did not take questions after the Mass.

The fatal police shooting came amid strong anti-police sentiment and protests after grand juries in both the Garner and the Brown cases voted not to indict police for the men's deaths.

Police union leaders criticized politicians, protesters and the media for fanning “the flames of hate and distrust of all law enforcement" that they said led to the killing of the two officers.

"This is a time when, due to the words and actions of our politicians, the safety of all members of the NYPD has been increasingly put in jeopardy," Lou Turco, president of the Lieutenants Benevolent Association, said in a statement.

"Our elected officials have irresponsibly added to an incendiary atmosphere of distrust against law enforcement,” he continued. "Their words and actions have emboldened and inexplicably legitimized the illegal actions of the ‘Peaceful Protesters.'"

The head of the city’s largest police union also slammed de Blasio and the Eric Garner protesters, saying they had “blood on their hands.”

"There's blood on many hands tonight," Patrolmen’s Benevolent Association president Pat Lynch said outside Woodhull Hospital Saturday night, where the officers were taken after the shooting.

"That blood on the hands starts on the steps of City Hall, in the office of the mayor."

But not all agreed with the unions’ criticism.

“The divisive things that he’s putting across the airwaves, if they continue, will cause more pain,” said Gary Watson, 58, who came to the site of the shooting from Upper Manhattan on Sunday morning.

Watson brought a money order that he intends to use to start a fund for families of slain police officers as well as victims who died at the hands of the NYPD. Watson had also lost a family member in the line of duty, he said.

"I was so happy to hear [Brooklyn Borough President] Eric Adams say, 'All lives matter,' because that’s what I want the fund to be called," he said.

The Justice League, which has organized many of the anti-police brutality marches in recent weeks, planned a silent candlelight march starting at 110th Street and Frederick Douglass Boulevard at 5 p.m. Sunday.

"We invite our friends, our family, and our neighbors to join us as we come together in solidarity to silently support each other and our beloved city in the pursuit of JUSTICE," the group wrote on the Facebook event page.

With reporting by Danielle Tcholakian