Officers said he knew the city: He was born in Brooklyn, where his mother lives; his sister lives in the Bronx. He had been to the city at least once in the week before the killings.
On Saturday, outside the Barclays Center, Mr. Brinsley discarded an iPhone he had earlier stolen from Ms. Thompson.
He made his way to central Brooklyn, emerging about two hours later on Tompkins Avenue, off Myrtle Avenue, in Bedford-Stuyvesant. There, he struck up a conversation with two men, Chief Boyce said, and said three things.
“He asked them for their gang affiliation; he asked them to follow him on Instagram; and then he says, ‘Watch what I’m going to do,’ ” Chief Boyce said.
Mr. Brinsley went north on Tompkins. He passed the patrol car with Officers Liu and Ramos inside. He circled, crossed the street and came up behind the car. From the sidewalk, he fired four bullets. He ran.
Two men in a Con Edison truck saw the shooting and, rather than running away, went after Mr. Brinsley. They shouted to nearby officers, pointing toward Mr. Brinsley, who then descended into a G train subway entrance on Myrtle and Marcy Avenues. Chief Boyce praised the heroism of the utility workers.
Officers converged on the street in a cacophony of sirens and frantic shouts. The fatally wounded officers were lifted from the patrol car, each into a separate ambulance that sped away trailed by a stream of blaring police cars. Around the car lay the officers’ bloody bullet-resistant vests, a gun belt and bits of glass.
Other officers flooded the subway platform. There Mr. Brinsley was discovered lying on the silver semiautomatic gun, nine bullets left, two MetroCards in his pocket. His last shot was a bullet to his temple, which officials said he fired himself.