Washington: For President Barack Obama, one of his most wrenching White House weeks saw the fresh spectre of terrorism and the first crushing political defeat of his new term, and the more emotional side of a leader often criticized for appearing clinical or detached.
The events presented sharp tests for a president committed to an ambitious agenda in the limited window offered by a second term.
There was the challenge to reassure a nervous nation about threats at home and to keep the rest of his legislative goals on track after the Senate rejected gun control measures that had become his top priority.
"This was a tough week," Obama said late on Friday, shortly after authorities captured the second suspect in the Boston Marathon bombings.
The Boston Marathon explosions and the gun votes overshadowed other events that would have captivated the country and consumed the White House during almost any other week.
An explosion levelled a Texas fertilizer plant, killing at least 14 people. Letters addressed to Obama and Republican Sen. Roger Wicker of Mississippi were found to contain traces of poisonous ricin in tests, evoking parallels to the anthrax attacks after the September 11, 2001, terrorist attacks.
"It's not new," David Axelrod, the president's former senior adviser, said of the White House balancing act. "It's never welcome, but it's not entirely unexpected."
The full fallout of the events and their impact on Obama's presidency remains uncertain. That's particularly true in Boston, where the motivations of the two brothers accused in the bombing are unknown, as are their connections to any terrorist network.
But the capture of the teenager whose older brother was killed attempting to escape police brought closure to Boston and the White House.
Throughout Friday, Obama aides watched coverage of the manhunt on Boston television stations being specially broadcast throughout the White House. When the search appeared to stall, the president retreated to the residence, but returned quickly to the Oval Office when news reports showed authorities closing in on 19-year-old Dzhokhar Tsarnaev.
Shortly before 9 p.m., FBI Director Robert Mueller relayed news of his capture to Obama counterterrorism adviser Lisa Monaco.
Just one day earlier, Obama had been in Boston to speak at an interfaith service for the three people killed and more than 180 others injured in the blasts at the marathon's finish line.
Obama balanced sorrow with resolve as he sought to console the grieving city. He said Boston would "run again" and pledged to bring the "small, stunted individuals" responsible for the bombings to justice.
His words won him rare praise from some Republicans, including former presidential rival Mitt Romney.
"I thought the president gave a superb address to the people of this city and the state and the nation," said Romney, a former Massachusetts governor who attended the interfaith service.
Previous terrorist attacks in the U.S. have turned into key leadership moments for the men who occupied the Oval Office directly before Obama.
For President Bill Clinton, the 1995 Oklahoma City bombing proved an opportunity to regain stature after his party's election defeats. For President George W. Bush, the events of Sept. 11, 2001, were a chance for the country to rally around a president elected under controversial circumstances.
Obama's address in Boston was his second emotional appeal of the week.
On Wednesday, he stood stone-faced in the White House Rose Garden after the Senate struck down the gun control measures he pressed for following the December massacre of 20 school children and six educators at Sandy Hook Elementary School in Newtown, Connecticut.
Flanked by the families of some of the Newtown victims, Obama let his anger show. He accused senators, including some fellow Democrats, of giving into their fear of the National Rifle Association, the influential gun rights lobbying group, and called the vote a "shameful day for Washington."
The White House, as it looks to restore order after a hectic week, has promised to keep fighting for stricter gun laws. But Obama's path forward is uncertain. Senate Majority Leader Harry Reid has shelved the issue indefinitely and Obama almost certainly won't spend much political capital getting them to consider it again.
Instead, the president probably will focus acutely on immigration reform. The long-anticipated release of a bipartisan Senate group's draft bill was largely overshadowed by other events.
Unlike his push on guns, Obama's immigration efforts have a clearer path to passage. The growing political power of Hispanic voters, who overwhelmingly sided with Obama in the November election, has led some Republicans to drop their opposition to an immigration bill that could eventually grant citizenship to millions of people living in the U.S. illegally.
Still, obstacles remain, a reality underscored when authorities disclosed that the suspects in the Boston bombings were immigrants - ethnic Chechens who had lived in southern Russia. While there was no evidence that the men entered the U.S. illegally, some Republicans seized on the events in Boston to raise questions about the existing immigration system and the proposed changes.
Despite the administration's desire to move on, former White House press secretary Ari Fleischer said "the smartest thing the White House can do is pause."
"Events are swirling furiously and they need to give it time and space to let the events settle," said Fleischer, who served under President George W. Bush during the Sept. 11 and anthrax attacks.
Putting on the brakes could prove difficult for the Obama White House, which began the year with a bold domestic agenda.
Aides know this year is their best chance of getting legislation through a divided Congress, before lawmakers turn their attention to the 2014 elections, then the race to replace Obama.