Media playback is unsupported on your device Media caption Col Timothy Alben of the Massachusetts State Police: "We're exhausted... but have a victory"

A teenager suspected of carrying out the Boston Marathon bombings is in custody after a local resident found him hiding in a boat in his backyard.

Police said they exchanged gunfire with Dzhokhar Tsarnaev, 19, after cornering him in Watertown, near Boston.

He had escaped on foot early on Friday, apparently wounded, after a police shootout that claimed the life of his elder brother, an alleged accomplice.

Three people died and more than 170 were wounded in Monday's bombings.

Analysis We may know the names of the suspects in the Boston marathon attacks and also much about their lives, but the question of why they did it remains elusive. Recollections of friends and family, as well as the digital data trail people now leave on social media, means we can get a picture of a young brother who seemed to be a well-adjusted student. The elder brother comes across less well-adjusted, not quite fitting into American life or making friends. Seven years older, some wonder if he drew his younger sibling into his own world in which he seemed to be exploring radical Islamist ideology. But was this simply about two brothers, a tight-knit bond with no outside support? An organised conspiracy would worry Americans who hoped that era had passed, but in some ways the era of small self-starting groups is just as worrying since they can be much harder to spot.

As news emerged that the teenaged suspect was being treated in hospital, US President Barack Obama promised to seek answers on what had motivated the bombers and whether they had help.

Dzhokhar Tsarnaev was found after a day of lockdown on Boston's streets and a night of bloodshed that had claimed the life of a police officer at Massachusetts Institute of Technology (MIT).

Sean Collier, 26, was fatally shot in Cambridge late on Thursday. Then, after a car was hijacked, a gun battle began further west, in Watertown.

A transport police officer was seriously hurt and one of the brothers, Tamerlan Tsarnaev, 26, was fatally injured.

He had died of bullet wounds and injuries from explosives strapped to his body, a hospital doctor said.

As thousands of Swat team officers scoured the streets for Dzhokhar Tsarnaev, Boston and its suburbs were brought to a standstill, with residents told to stay indoors.

Breakthrough

Despite house-to-house searches in the Watertown area, nothing was found and the trail appeared to have gone cold.

The Tsarnaev brothers Image copyright Reuters Sons of Chechen refugees from the troubled Caucasus region of southern Russia

Family is thought to have moved to the US in 2001, from Russian republic of Dagestan

They lived in the Massachusetts town of Cambridge, home to Harvard University

Dzhokhar, 19, was awarded a scholarship to pursue further education; he wanted to become a brain surgeon, according to his father

Tamerlan, 26, was an amateur boxer who had reportedly taken time off college to train for a competition; he described himself as a "very religious" non-drinker and non-smoker Profile: The Tsarnaev brothers Q&A: Suspects' Chechen links Maps of manhunt Timeline of manhunt

It was not until 19:00 local time (23:00 GMT), an hour after the city-wide lockdown order was lifted and the transport system had reopened, that the breakthrough came.

A resident of Franklin Street, Watertown, emerged from his home and noticed blood near a boat in his backyard,

Upon opening the tarpaulin covering the boat, he found a man covered in blood in the stern and called police.

Bomb-squad vans and ambulances surrounded the house, while helicopters buzzed overhead.

"The hostage rescue team did try to talk him out but from what I understand, he was not communicative," Boston Police Commissioner Ed Davis told reporters.

Officers tossed flash-bang grenades into the boat to disorient the fugitive.

Police said they exchanged gunfire with the suspect for about an hour before moving in and seizing him. Images show the teenager climbing out of the boat and then lying on his back as he is searched by police.

A crowd near the scene cheered as he was taken into custody.

Boston Police Department tweeted: "CAPTURED!!! The hunt is over. The search is done. The terror is over. And justice has won. Suspect in custody."

Dzhokhar Tsarnaev was taken to a Massachusetts hospital, bleeding and seriously injured with gunshot wounds to the neck and leg, police told reporters.

Russian warning?

Little more than an hour later, President Obama praised the "character of our country" after what he said had been a tough week in which the world had seen Americans refusing to be terrorised.

Media playback is unsupported on your device Media caption President Obama: "There are still many unanswered questions"

"If anyone wants to know who we are; what America is; how we respond to evil and terror - that's it. Selflessly. Compassionately. And unafraid."

The Boston manhunt had begun with two explosions at the finish line of Monday's marathon.

The twin blasts killed Martin Richard, aged eight, Krystle Campbell, 29, and Lu Lingzi, 23, a postgraduate student from China.

The climax to the search for their suspected killers began hours after the FBI released images of the bombing suspects.

Law enforcement officials and family members identified the Tsarnaev brothers as ethnic Chechens who had been living in America for about a decade.

The FBI had interviewed Tamerlan Tsarnaev in 2011 after a request from a foreign government, US law enforcements officials have confirmed. But agents closed the case after finding no cause for concern.

Suspects' origins Chechnya (pair were ethnic Chechens): Southern Russian republic, rich in oil. Infrastructure hit by years of war between separatists and Russian forces, banditry and organised crime. Improved security situation has led to increased investment in reconstruction projects. But sporadic attacks by separatists continue. Dagestan (pair lived here for several years): Southern Russian republic, translating as "land of the mountains", famed for ethnic and linguistic diversity. A long-running militant Islamist insurgency is a thorn in the authorities' side. Dagestan has oil reserves and a strong manufacturing sector, but rampant corruption and organised crime . Dagestan profile Chechnya profile

It is not known which country made the request, but the BBC's Paul Adams in Washington says it is likely to have come from the Russians.

In an interview on Russian television, the mother of the two suspects said the FBI had been in contact with her son for several years.

The Kremlin said on Saturday that President Vladimir Putin had agreed with President Obama during a telephone conversation to increase co-operation in the wake of the Boston attacks.

'Losers'

Our correspondent says now that the manhunt in Boston is over, the extent of the FBI's prior knowledge of Tamerlan Tsarnaev's activities is likely to be examined.

Dzhokhar Tsarnaev's father said on Friday that his son was a second-year medical student in the US and was hoping to be a brain surgeon.

Anzor Tsarnaev, speaking from Dagestan, told the BBC he believed the secret services had framed his sons.

"It was a terrorist attack carefully organised by secret services - I don't know which ones. My son used to go to a mosque, so they once paid us a visit to ask why he is doing that.

"Yes, there was such an episode. So they put all the blame on him and shot him. That's it."

But Ruslan Tsarni, an uncle of the suspects who lives in Maryland, said he was "ashamed" at his nephews' alleged role in the bombings.

Asked what the bombers' motives may have been, he replied: "Being losers, hating everyone around them."

Also on Friday, investigators removed a computer and other evidence from the New Jersey home of the Tsarnaev brothers' sister, police said.

Ailina Tsarnaeva, who lives in the town of West New York, is said to have told FBI agents she had had no contact with her brothers for some time.