For all of Obama’s efforts at rapprochement with much of the world, he—like George W. Bush—was a wartime president. With the situation in Iraq continuing to improve and the target date for ending U.S. combat operations there approaching, in February 2009 Obama increased the U.S. military presence in Afghanistan to 68,000 troops. Throughout his presidential campaign he had argued that the focus of U.S. military efforts should be in Afghanistan rather than Iraq, and, with the resurgence of the Taliban in Afghanistan, the military requested that Obama deploy an additional 40,000 troops there. After carefully weighing the situation for three months, Obama choose to send an additional 30,000 troops, a decision that was criticized by many in his party.

Barack Obama speaking to military personnel at Camp Victory in Baghdad, April 7, 2009.Charles Dharapak/AP

In June 2010, as the Afghanistan War rivaled the Vietnam War as the longest in U.S. history and as American war deaths there topped the 1,000 mark, the president was faced with another challenge when Gen. Stanley McChrystal, commander of NATO-U.S. forces in Afghanistan, and members of his staff made derisive comments about top Obama administration officials to a reporter from Rolling Stone magazine. Obama relieved McChrystal of command, replacing him with Gen. David Petraeus, who had been responsible for the surge strategy in Iraq. In August, on schedule, the U.S. combat mission in Iraq came to a close; though 50,000 American troops remained, the majority of U.S. forces had been withdrawn. In a televised national address marking the end of Operation Iraqi Freedom, Obama stressed the importance of American and NATO efforts in Afghanistan even as corruption continued to undermine the faith of the Afghan people in their government.

Many columnists and political cartoonists were quick to see parallels between the potential pitfalls prolonged involvement in Afghanistan held for Obama’s ambitious plans for social legislation and the way in which the Vietnam War had undermined Pres. Lyndon B. Johnson’s efforts to build the Great Society. With the prospect of double-dip recession looming in summer 2010, some said Obama had been too preoccupied with the wars to give the economy the needed attention.

In the run-up to the fall’s midterm congressional election, Obama found himself snagged in controversy over whether an Islamic centre and mosque should be built in New York City near the site of the September 11, 2001, attacks. Initially the president reacted by strongly supporting the constitutional right of Muslim Americans to freedom of religious expression, but then he seemed to waffle regarding the location of the mosque. All this came at a time when polling showed that nearly one-fifth of Americans incorrectly believed that Obama was Muslim, up from about one-tenth a year earlier.

The midterm congressional election and its aftermath

As Americans headed into the midterm election of 2010, much of the electorate was characterized as angry and pessimistic. The struggling economy and a persistent high level of unemployment were the central issues in an election that was widely viewed as a referendum on the first two years of Obama’s presidency. In the weeks before the election, Obama campaigned hard for Democratic candidates and sought to convince voters of the importance of his administration’s accomplishments, including staving off what some economists believed was a potential economic depression. He also emphasized that the change he had promised as a presidential candidate, as well as the Democratic Congress’s efforts to stimulate the economy, would take time. In the event, many of the independents who had supported Obama and other Democrats in the 2008 election swung back to the Republicans, and voters returned control of the House to the Republicans, who gained some 60 seats (the biggest swing since 1948). Although the Democrats held on to control of the Senate, their majority was severely reduced. Chastened but unbowed by the election results, Obama approached the second half of his term and the challenges of divided government with a renewed call for bipartisanship.

With only weeks remaining in the congressional term, Obama and the administration aggressively courted Republicans with compromise proposals that resulted in a flurry of significant legislation that marked the lame-duck Congress as one of the most productive bodies in recent memory and that brought a rebound to the president’s popularity. Breaking a campaign pledge, Obama agreed to extend to all Americans (including the wealthiest) for another two years the tax cuts that had been enacted under the Bush administration. In return Republicans voted to extend unemployment benefits. In addition Congress rescinded the military’s “Don’t Ask, Don’t Tell” policy to allow gays and lesbians to serve openly in the armed forces (fulfilling one of Obama’s campaign promises). Congress passed legislation that increased the number of children served by the school lunch program and improved the quality of food to be provided. And Congress extended medical benefits and compensation for the rescue workers who had responded to the September 11 attacks. Moreover, the Senate ratified a new Strategic Arms Reduction Talks (START) treaty with Russia—one of the administration’s top foreign policy goals. On the other hand, a Republican filibuster in the Senate stalled the Development, Relief, and Education for Alien Minors (DREAM) Act, which would have granted eventual citizenship to aliens brought to the United States when they were age 16 or younger.

U.S. President Barack Obama signing the repeal of “Don't Ask, Don't Tell,” December 22, 2010.Chuck Kennedy—Official White House Photo

U.S. Pres. Barack ObamaIntroduced by Vice Pres. Joe Biden, U.S. Pres. Barack Obama speaking before signing into law the repeal of “Don't Ask, Don't Tell,” December 22, 2010.Official White House Video

But even as gridlock was at least temporarily dislodged and partisanship eased during the season of legislative success, the debate over the vehemence of political polarization was quickly again at the centre of the national conversation when, on January 8, 2011, a gunman killed six people and critically wounded Gabrielle Giffords, a member of the U.S. House of Representatives, as she met with constituents in Tucson, Arizona. Giffords, a moderate Democrat who had voted to support the health care bill, had already had her office vandalized and had experienced an aggressive challenge to her seat from a Republican candidate who was backed by Tea Party supporters. She survived the gunman’s attack. In a well-received speech at a memorial for the victims in Tucson, Obama called for civility in American politics and public discourse and for discussions that heal instead of harm. “Rather than pointing fingers or assigning blame,” he said, “let us use this occasion to expand our moral imaginations, to listen to each other more carefully, to sharpen our instincts for empathy, and remind ourselves of all the ways our hopes and dreams are bound together.”

U.S. Pres. Barack Obama speaking at the memorial for the victims of the shooting in which Rep. Gabrielle Giffords was wounded, Tucson, Ariz., Jan. 12, 2011.Official White House Video

In Libya, where the political revolt against the four-decade rule of Muammar al-Qaddafi transformed effectively into a civil war (seeLibya Revolt of 2011), however, Obama felt U.S. intervention was necessary to prevent a humanitarian disaster as Qaddafi employed his overwhelming military advantage in a brutal attempt to expunge opposition. On March 19, U.S. and European forces with warplanes and cruise missiles began attacking targets in Libya in an effort to disable Libya’s air force and air defense systems. After initially taking a leading role in these operations, the Obama administration relinquished command to the North Atlantic Treaty Organization on March 27.

On April 4, Obama officially announced that he would seek reelection. Less than a month later, on May 1, the president made a dramatic late-night Sunday television address to inform the world that U.S. special forces had killed al-Qaeda leader Osama bin Laden in a firefight in a compound in Abbottabad, Pakistan, not far from the Pakistani capital of Islamabad. (U.S. forces took custody of the body, which they buried at sea, and confirmed bin Laden’s identity through DNA testing.) “Justice has been done,” Obama said. “Americans understand the costs of war. Yet as a country, we will never tolerate our security being threatened, nor stand idly by when our people have been killed. We will be relentless in defense of our citizens and our friends and allies.”

Pres. Barack Obama (seated second from left) and various government officials—including Vice Pres. Joe Biden (seated left), Secretary of Defense Robert M. Gates (seated right), and Secretary of State Hillary Clinton (seated second from right)—receiving updates in the Situation Room of the White House during the Osama bin Laden mission, May 2011.Pete Souza—Official White House Photo