Police-community relations, already strained by nationwide protests over the deaths in recent months of unarmed black people at the hands of white officers, grew even more fragile Sunday in the wake of the assassination-style slayings of two New York City patrolmen.

A day after officers Wenjian Liu and Rafael Ramos were fatally shot in their patrol car, recriminations flew in the country’s largest city, with Mayor Bill de Blasio standing at the epicenter. Critics blamed the mayor and his aggressive campaign to reform police practices for the shootings, with officers taking the extraordinary step of silently turning their backs on de Blasio as he entered the hospital where the two patrolmen died.

Relations between the mayor and officers have become so strained, former New York City police commissioner Ray Kelly said in an interview, that de Blasio “probably needs an intermediary to go between himself and the [police] unions, maybe a religious leader.”

While other New York elected officials defended the mayor, concerns about more anti-police violence extended elsewhere, with departments and police unions in states including Massachusetts and New Jersey warning officers to be on high alert.

In the Washington area — where suspect Ismaaiyl Brinsley on Saturday allegedly shot and wounded his former girlfriend near Baltimore before traveling to Brooklyn, killing the two police officers and taking his own life — officers said they felt vulnerable. “We are in uniform and in marked cars,” said Delroy Burton, head of the D.C. Fraternal Order of Police. “There is no way to defend against someone who wants to do us harm. There is no way to see it coming.”

Here is a timeline tracking the events before two NYC police officers were shot earlier on Saturday.

More information emerged Sunday about the slayings of the officers, as well as the background of the alleged shooter. Police described Brinsley as a highly troubled man with a violent past, saying he had been arrested 19 times — 15 times in Georgia and four in Ohio — and that his mother had feared him. A year ago, they said, Brinsley tried to hang himself.

While authorities said it was unclear whether Brinsley had been involved in the protests that have roiled the nation in recent weeks, leaders of the burgeoning national movement against police violence worked to distance themselves from the events in New York. Even so, the level of blame laid at their feet by some politicians illustrated the tense atmosphere.

Just three hours before Saturday’s shootings, authorities said, Brinsley declared his intention on his Instagram account to kill police officers as retribution for the police killings of Michael Brown in Missouri and Eric Garner in New York City.

Former New York mayor Rudolph W. Giuliani (R), known for his tough anti-crime policies in the 1990s, blamed not only the protesters for Saturday’s shootings but also the sympathy they have garnered from de Blasio and President Obama.

“We’ve had four months of propaganda, starting with the president, that everybody should hate the police,” Giuliani said on “Fox and Friends Weekend.” “I don’t care how you want to describe it: That’s what those protests are all about.”

De Blasio has condemned the killings as “a despicable act,” and the White House said Obama called New York City Police Commissioner William Bratton on Sunday morning to express his condolences. “The President reiterated his call for the American people to reject violence and words that harm, and turn to words that heal — prayer, patient dialogue, and sympathy for the friends and family of the fallen,” the White House said in a statement.

Details about the suspect

Police on Sunday said Brinsley, 28, had a long criminal record and an apparent history of mental illness.

Born in Brooklyn, Brinsley attended high school in New Jersey, with his mother telling officers that he was violent growing up and that she feared him, according to Robert Boyce, NYPD chief of detectives.

While Boyce said at a news conference that he would not speculate on a motive, he said Brinsley had burned a flag in one Instagram posting and mentioned Brown and Garner in others.

Soon before the officers were shot in the head at point-blank range while sitting beside each other in a police car in the East Flatbush neighborhood of Brooklyn, Brinsley approached several witnesses on the street, asked them to follow him on Instagram and said, “Watch what I’m going to do,” police said.

After the shooting, Brinsley ran up the street and was pursued by other officers into a subway station, where he was found with a gunshot wound that appeared to be self-inflicted, police said. He was declared dead at a nearby hospital, police said.

Authorities Sunday also detailed the Washington area’s connection to the attacks. Police said the same 9mm semiautomatic handgun that killed Liu and Ramos was probably used earlier Saturday near Baltimore to shoot and wound Brinsley’s former girlfriend. Police identified her as Shaneka Nicole Thompson, 29.

Before he made his way to Brooklyn on Saturday morning, police said, Brinsley shot Thompson at about 5:45 a.m. in Owings Mills, Md., about 15 miles outside Baltimore.

In a statement, Baltimore County police said she was wounded in the abdomen, and is in critical but stable condition at an area hospital but is expected to survive. Officers said they have not been able to interview her because of her condition but were hoping to speak with her later Sunday.

Brinsley’s address is unknown, and the police statement said that authorities “believe he has no ties to the Baltimore area except Thompson.” Police said that they believe Brinsley and Thompson had a previous romantic relationship that dates back less than a year and that Thompson lived alone at the apartment where she was shot.

“There is no indication of prior criminal activity by Brinsley in Maryland,” the statement said.

The shooting early Saturday occurred inside an apartment at Greenwich Place at Town Center, a gated complex. Apartment managers told a reporter to leave Saturday night and Sunday morning.

Thompson’s 71-year-old grandfather, James Delly, who lives in South Carolina, said that he had never heard of the suspect and that his granddaughter, with whom he is close, never mentioned him. “I don’t know anything about him,” he said in a telephone interview Sunday.

He said Thompson’s mother, who lives in South Carolina, is in Baltimore with her daughter at the hospital. Of the family, Delly said, “I think they’re just holding out to see if my granddaughter is going to come through.”

Pointing fingers

The recriminations directed primarily at de Blasio for the shootings began Saturday, with the head of a New York City police union saying the mayor had blood on his hands and former New York governor George Pataki (R) saying on Twitter that the shootings “sadly are a predictable outcome of divisive anti-cop rhetoric” of the mayor and Attorney General Eric H. Holder Jr.

Asked about Pataki’s tweet in an interview Sunday on CBS’s “Face the Nation,” Sen. Lindsey O. Graham (R-S.C.) said, “I blame the shooter and nobody else.”

But he added, “I think the mayor of New York has probably undercut his cops, and the attorney general is trying to walk a fine line.”

Others defended de Blasio, arguing that he is trying to bridge divisions, not widen them. De Blasio campaigned for mayor in part on reforming police tactics that he said had unfairly targeted minorities — especially the controversial “stop and frisk” policy, under which police stopped virtually anyone deemed suspicious.

“I think the tone that the mayor is trying to set is a tone that brings people together,” Rep. Gregory W. Meeks (D-N.Y.) said on ABC’s “This Week.” “We stand with the police department. No one has ever given up on the police department or said we were anti-police-department. What we were crying for was just saying how African Americans feel — how their communities are policed.’’

Leaders of the diverse movement that has been protesting police tactics also took pains to distance themselves and their organizations from the killings.

In statements, social-media postings and interviews, protest organizers struck a unified message, emphasizing that the shootings were tragic and not linked to the protests. They pointed to their repeated public calls advocating nonviolence.

“We’ve all said that this is a horrible thing that shouldn’t have happened,” said Charles Wade, a leading protest organizer. “I say time and time again that I’m against police violence and I’m not against police officers in general.”

Back in Brooklyn, a memorial continued to grow at the site where the officers died. Ramos, 40, was a lifelong Brooklyn resident who joined the police force after working as a school security guard, according to the Associated Press. He was married with two sons, a 13-year-old and one in college, the AP reported. His younger son, Jaden, said goodbye to his father Saturday night in a post on Facebook: “Today I had to say bye to my father. He was the best father I could ask for. . . . I will always love you and never forget you. RIP Dad.”

Liu, 32, had been with the force for seven years and had gotten married just two months ago, the AP reported.

Supporters at the memorial site Sunday used a phrase associated with protest movements to express their grief. They held candles and sang, “We shall overcome.”

Jessica Dunn, 34, a local resident, pushed her way through the crowd to lay a bouquet of roses at the memorial. “I came to pay my respects. We need to let the police know how much this community needs them, especially right now,” she said. “I came to show respect.”

Amy Ellis Nutt and Danielle Paquette in New York, and Peter Holley, Sean Sullivan, Wesley Lowery and Alice Crites in Washington contributed to this report.

Correction: An earlier version of this article imprecisely quoted a police union leader as saying de Blasio had “blood on his hands.” The quote from Patrick Lynch was, “There’s blood on many hands tonight,” and he added,“That blood on the hands starts on the steps of City Hall in the office of the mayor.”