Editor’s Note: This story appeared in the Sunday night online version of NYTimes.com. We reprint part of it here.

Mayor Bill de Blasio sat in the front pew at St. Patrick’s Cathedral on Sunday, head bowed at times, with his wife on his left and the police commissioner on his right.

The crowd had come, Cardinal Timothy M. Dolan said, to mourn the two officers killed in an ambush in Brooklyn on Saturday. It had come to pray for their families and their “brothers and sisters in uniform.”

He went on.

“We pray for our leaders as well,” the cardinal said, looking toward the mayor’s row. “You’ve done what so many New Yorkers do in times of trial. You’ve come to St. Patrick’s.”

At the helm of a grieving New York, still raw from weeks of protests amid a national reckoning over law enforcement and race, Mr. de Blasio faces his biggest test yet.

The mayor, who does not attend church regularly, did not speak publicly on Sunday. His administration said he hoped to convey, in subdued terms, the need for unity in the city.

Yet on the heels of the police deaths, the long-simmering tensions between Mr. de Blasio and the department he has pledged to reshape have reached an extraordinary nadir. Officers, led by union leaders, turned their backs on the mayor and Commissioner William J. Bratton on Saturday night as the two walked through a hospital to address the public about the deaths.

The president of the city’s largest police union, Patrick Lynch, blamed Mr. de Blasio for the tragedy. The officers’ blood “starts on the steps of City Hall,” he said, “in the office of the mayor.”

Read the full story.