Mr. Brinsley had also suffered from mental problems. Relatives told the police he had taken medication at one point, and when he was asked during an August 2011 court hearing if he had ever been a patient in a mental institution or under the care of a psychiatrist or psychologist, he said yes. He had also tried to hang himself a year ago, the police said.

By this year, Mr. Brinsley had become isolated. He was estranged from his family. His on-again, off-again relationship with Shaneka Thompson, 29, who works for the Maryland Department of Welfare and serves in the Air Force Reserve, was off again. By Saturday, he had seized on the deaths at the hands of police officers of Eric Garner on Staten Island and Michael Brown in Ferguson, Mo., focusing his rage against the authorities. In his short life, during which Mr. Brinsley failed to finish high school, to hold a steady job or, seemingly, to commit even the smallest crime without being caught, thoughts of revenge seemed to be the one thing giving him purpose.

“Most of his postings and rants are on the Instagram account, and what we’re seeing from this right now is anger against the government,” Robert K. Boyce, the Police Department’s chief of detectives, said at a news conference on Sunday. Chief Boyce added that one of those posts showed a burning flag, and in others Mr. Brinsley talked of the anger he felt toward the police. There were, Chief Boyce said, “other postings as well, of self-despair, of anger at himself and where his life is right now.”

No members of his family spoke of Mr. Brinsley with fondness. He bounced from family home to family home growing up, attending high school in New Jersey but reaching only the 10th grade. A sister in Atlanta, Nawaal Brinsley, said she had not seen him in two years. Another sister who had lived in the Bronx could not be reached, but the police said they had been called to a dispute with Mr. Brinsley at her home in 2011. Mr. Brinsley’s mother, who lives in Brooklyn, told the police she feared her son and had not seen him in a month. She said “he had a very troubled childhood and was often violent,” Chief Boyce said.

Mr. Brinsley was so transient that the police did not have a solid address for him. That made tracing his movements difficult, even as his disintegration was there for anyone to see online. But his movements on Saturday had become clearer by Sunday, according to the police.