SAY WHAT: Click the image to watch President Obama's speech and read the full text with analysis from The Post's politics and technology writers.

Four months after taking office, President Obama spoke at the National Archives, steps away from the Constitution, and described in sharply critical terms “the season of fear” in the United States that followed the Sept. 11, 2001, attacks.

Torture had been practiced in interrogations. Terrorism suspects were held without trial in an offshore military prison. U.S. troops invaded a country without links to the attacks on New York and Washington. The National Security Agency was exposed for eavesdropping on U.S. citizens without warrants.

“In other words,” Obama said, “we went off course.”

It was understood that Obama, the constitutional law lecturer, would find the country’s compass.

But as Obama acknowledged Friday, in a speech delivered just around the corner from the archives at the Justice Department, he is still navigating the politically complicated legacy of the “war on terror.” It is a legacy that has profound implications for his own as president.

“When you cut through the noise, what’s really at stake is how we remain true to who we are in a world that is remaking itself at dizzying speed,” Obama said Friday, in an echo of his message almost five years ago.

Obama moved quickly to fulfill his pledge to close the military prison at Guantanamo Bay, Cuba, although political obstacles have prevented him from seeing it through. Also in those first days, he officially banned the practice of torture in interrogation, methods that had ceased by the close of the Bush administration.

But those were issues where Obama’s policy inclinations, his principles and the politics of his party all came together — the easiest remnants of post-9/11 national security policy to criticize and work to end. Now he faces a more consequential challenge in changing, amid public pressure at home and abroad, a series of intelligence practices that he has called useful in preventing another terrorist attack in the United States.

“This is the hard stuff,” said Anthony D. Romero, executive director of the American Civil Liberties Union. “The surveillance collection issues will go to the heart of what America is all about for generations to come. The due process issues, the torture issues certainly go to American values. But they will not affect the vast majority of Americans or others around the world. This is where the rubber meets the road.”

Obama spoke both as a longtime lawyer and as a second-term commander in chief, more defensive than contrite over the work done by U.S. intelligence officers and of the utility and care with which the NSA’s bulk collection program has been managed.

“It may seem sometimes that America is being held to a different standard, and I’ll admit the readiness of some to assume the worst motives by our government can be frustrating,” Obama said. “But let us remember that we are held to a different standard precisely because we have been at the forefront in defending personal privacy and human dignity.”

The changes Obama ordered to NSA practices emphasize additional oversight — the “checks and balances and accountability” that he first mentioned at the National Archives years ago.

Other than curtailing American eavesdropping on allied leaders, the agency’s collection efforts will remain largely intact, an enduring concern to privacy groups who argue that the government has no right to collect information about U.S. citizens without a warrant.

Many of the programs disclosed by The Washington Post and the British newspaper the Guardian in recent months, based on documents provided by former NSA contractor Edward J. Snowden, will remain untouched.

Having run for office as a critic of the Bush administration’s national security policies, Obama was always going to be measured, in part, by how he scaled back the excesses of post-9/11 national security practices and preserved the essentials in a still-dangerous world. The reviews on that account have been mixed.

Obama withdrew U.S. troops from Iraq, a conflict he once called a “dumb war,” and has set an end-of-the-year end date for U.S. participation in Afghanistan’s war.

At the same time, he has expanded the battlefield for the U.S. drone fleet and stepped up the tempo of strikes from the Bush years, another counterterrorism tool that many within his party say should have far more accountability and oversight.

Only the bombings in Boston last year could be considered a successful mass terrorist attack on Obama’s watch, although there have been some near misses.

As Obama alluded to several times Friday, technological leaps have both greatly expanded U.S. surveillance capabilities and made obsolete the rules governing those practices.

Setting those limits now involves a set of decisions, some of which Obama presented Friday, that put into conflict his role as a commander in chief and the promises he made as a new president, particularly to those in his own party.

Obama made himself vulnerable to conservative charges that by ending some Bush administration national security policies, he was putting the nation at risk of another attack. He argued that American values and national security policy could coexist.

But he and his advisers were also mindful that his credibility on the subject — and more broadly, his political viability — would likely be only a terrorist attack away from ruin as a result.

As the more visible elements of post-9/11 national security policy diminished, namely the large military deployments overseas, the secret elements typified by drone strikes and electronic spying grew under a president who had promised unprecedented transparency. He captured the conflict in his Friday speech.

“I maintained a healthy skepticism toward our surveillance programs after I became president,” Obama said Friday, even though he had previously acknowledged that he was unaware of the sensitive “head of state” program that targeted the personal cellphones of such allies as German Chancellor Angela Merkel.

Obama’s political considerations are particularly challenging on the question of surveillance, resembling those he had to consider when deciding whether to increase the U.S. presence in Afghanistan four years ago.

Now, as then, many in his party are demanding more change to the NSA’s spying practices than he is willing to carry out. A Washington Post-ABC News poll in November found that Democrats were twice as likely to disapprove of Obama’s handling of the NSA than of his overall job performance.

The party ambivalence was reflected on Capitol Hill in the hours after Obama’s speech. Some Democrats applauded the president for addressing the controversy, particularly over the phone-record collection program, while others urged him to do more.

“The reforms outlined by President Obama today are a welcome first step in reining in the government’s unacceptable infringement on Americans’ privacy rights,” Sen. Tom Udall (D-N.M.) said in a statement. “But I’m not satisfied these reforms go far enough.”

Behind Obama’s words Friday was a question asked increasingly around the West Wing: How does he want to be remembered?

To a president who has already made history by being the first African American to hold the office, Obama’s answer goes beyond a simple record of his administration.

He is mindful of history and his place in it, and to many of his advisers and supporters, any assessment of his legacy should provide the end of the sentence: “He was the president who . . .”

Successfully ended the “season of fear” and the government excesses that defined it? Or cemented in place a vast surveillance state he once opposed? On Friday, he began to provide the answer.

“I have often reminded myself that I would not be where I am today were it not for the courage of dissidents, like Dr. King, who were spied on by their own government,” Obama said. “And as a president, a president who looks at intelligence every morning, I also can’t help but be reminded that America must be vigilant in the face of threats.”

Scott Clement contributed to this report.