President Obama on Friday cheered the capture of the second suspect in twin bombings at the Boston Marathon, praising a successful manhunt that shut down the heart of New England but ultimately “closed an important chapter in this tragedy.”

“All in all, this has been a tough week,” Obama said just after 10 p.m. from the White House Briefing Room. “But we’ve seen the character of our country once more.”

Earlier Friday, authorities took 19-year-old Dzhokhar Tsarnaev into custody, pinning him down in a boat in the back yard of a residence in Watertown, Mass. Boston became a virtual ghost town on Friday, as residents stayed in their homes while police looked for the fugitive.

After Tsarnaev was taken to a local hospital with critical injuries, Bostonians lined the streets, giving thunderous applause to a parade of local and federal law enforcement officials.

And the president promised justice for the four people — including a police officer — killed and more than 170 injured in Boston.

“The families of those killed so senselessly deserve answers,” he said.

Obama vowed that his administration would work to shed light on the many remaining, unanswered questions.

“Why did young men who grew up and studied here as part of our communities and our country resort to such violence?” he asked. “How did they plan and carry out these attacks, and did they receive any help?”

Amid another act of senseless violence, Obama said Americans had shown their resiliency and that Boston had already united the country.

“They failed because the people of Boston refused to be intimidated,” he said. “They failed because as Americans, we refuse to be terrorized. They failed because we will not waver from the character and the compassion and the values that define us as a country.”