As their photographs spread rapidly across the Internet, the Tsarnaev brothers decided to make their move. Not waiting for police to find them, they gathered guns and homemade explosives for what became a final, bloody rampage on a community still in shock from the bombing three days before.

In less than 15 minutes late Thursday, authorities said, the brothers fatally shot a campus police officer as he sat in his car, then carjacked a Mercedes-Benz sport-utility vehicle at gunpoint. They held the driver hostage for 30 minutes as they scoured Boston’s western suburbs for bank machines from which to take the man’s cash.

Finally discovered, the Tsarnaevs led police on a chase through residential streets, hurling grenades and makeshift bombs as they drove. When cornered, they battled police with guns and more homemade explosives, wounding a transit officer and trading more than 200 rounds until the officers ran out of ammunition.

The drama ended for the elder brother, Tamerlan, 26, when police shot him and then he apparently was run over by his brother in a melee witnessed by scores of frightened residents of Watertown, Mass., a residential community about five miles from the apartment where the pair lived.

The younger brother, Dzhokhar, 19, fled on foot, somehow eluding police and beginning a widespread search by thousands of federal agents and state and local officers. The hunt shut down much of metropolitan Boston for hours and transfixed millions of Americans who watched the events unfold.

See the full sequence of events in the aftermath of the Boston Marathon bombings.

On Friday night, soon after state police held a news conference saying they did not know where Dzhokhar Tsarnaev was hiding, he was discovered in a plastic-covered boat parked in the driveway of a Watertown home. Police surrounded the boat and, after nearly three hours, brought him out alive.

The younger Tsarnaev, a former high school wrestler, was identified along with his brother as a suspect in Monday’s bombing near the crowded finish line of the Boston Marathon that killed three people and wounded more than 170.

It is unclear whether investigators knew the suspects’ names when they released photographs and videos of them along the marathon course around 5 p.m. Thursday in what the FBI said was an appeal for help from the public. Within minutes, the images circulated worldwide on the Internet and in continuous loops on television networks.

Law enforcement officials had hoped that a wide distribution of photos would bring clues. Instead, it appears to have jarred the Tsarnaevs into action. After apparently spending three days watching the aftermath of the bombing from nearby Cambridge, the two left their apartment within hours of the FBI news conference, heavily armed and prepared for a fight. Whether they intended to flee the area or provoke a confrontation is unclear.

The following account was provided by multiple law enforcement officials involved in the manhunt or the bombing investigation. Several of them spoke on the condition of anonymity because the probe is ongoing.

Just after 10:30 p.m. Thursday, the pair walked up to a parked police car at the Massachusetts Institute of Technology, where Sean Collier, a 26-year-old campus officer, was nearing the end of his 3-to-11 p.m. shift.

A security camera would later show two men approaching the car and speaking to the officer. Abruptly, one of the men was seen pulling a gun and shooting Collier multiple times, including once in the head. Some officers concluded that the shooting was an effort to provoke a larger confrontation with police.

“They were looking to start something,” one official said.

Collier was found in his car by other police and taken to a hospital, where he was pronounced dead. By then, the Tsarnaevs had moved on.

At 10:39 p.m., just blocks from the cruiser in which Collier lay bleeding, the pair held up the driver of a black Mercedes SUV. Hijacking the car, they drove through Cambridge to nearby Watertown, a middle-class suburb of 30,000 where they searched for bank machines.

“They tell [the driver] they’re the bombers,” said a law enforcement official familiar with the account given by the SUV’s owner, who was released unharmed after a 30-minute ordeal.

The Tsarnaevs stopped at three ATMs and got $800 cash from one of them, using the SUV owner’s bank card. A surveillance camera at one bank recorded images of a young man resembling Dzhokhar Tsarnaev, dressed in a gray hooded jacket.

Denied cash at other ATMs, the suspects dropped off the vehicle owner at a gas station.

“The guy was very lucky that they let him go,” Massachusetts State Police spokesman David Procopio said of the hostage, whose name was not immediately released.

Just after midnight, police responding to the crime spree spotted the Mercedes and gave chase. The SUV tore through the nearly empty streets of Watertown with as many as a dozen police cars in pursuit. The officers had to dodge homemade bombs hurled from the speeding Mercedes.

At 12:50 a.m., the SUV stopped in a residential neighborhood in Watertown. The brothers opened fire, igniting a gun battle witnessed by neighbors peering from houses. One of them, Andrew Kitzenberg, 29, said he saw two men engaged in “constant gunfire” with police. Richard J. Donohue, 33, a three-year veteran of the transit police force, was shot and seriously wounded during the confrontation.

After more than 200 rounds were traded over several minutes, some officers were out of ammunition and charged the brothers’ position with their police car. The vehicle was disabled by gunfire from the Mercedes. Kitzenberg said he saw one of the shooters toss a metallic object — possibly a pressure-cooker bomb similar to the ones used in the marathon attack — in the direction of the police line. It rolled a few yards before detonating harmlessly.

Tamerlan Tsarnaev, now out of his car, attempted to lob a makeshift bomb at police, but the device exploded in his hand. While Tamerlan Tsarnaev was firing a pistol with the other hand, police tackled and tried to subdue the 200-pound amateur boxer.

Dzhokhar Tsarnaev, apparently intending to help his brother, tried to ram the officers with the Mercedes. Instead, the officers lunged out of the vehicle’s path and he ran over his brother and dragged him along the street before speeding off with police in pursuit.

Officers found the Mercedes abandoned and quickly sealed off neighborhoods in Watertown as they began a street-by-street search for the suspect. But police acknowledged later that there were not enough officers to establish a solid perimeter and that the suspect, who may have been wounded, had escaped.

Tamerlan Tsarnaev was taken to a hospital where he was pronounced dead on arrival. Hospital officials said he had been shot multiple times and suffered other wounds, apparently from an explosion.

Late Friday afternoon, state and local authorities held a news conference in Watertown and said they did not know Dzhokhar Tsarnaev’s location. Shortly after 6 p.m., however, the streets of Watertown came alive with sirens — the police had cornered the suspect.

Annie Gowen and David Montgomery in Boston contributed to this report.