Inside the White House situation room on the morning terrorism transformed America, Franklin C. Miller, the director for defense policy, was suddenly gripped by a staggering fear: "The White House could be hit. We could be going down."

The reports and rumors came in a torrent: A car bomb had exploded at the State Department. The Mall was in flames. The Pentagon had been destroyed. Planes were bearing down on the capital.

The White House was evacuated, leaving the national security team alone, trying to control a nation suddenly under siege and wondering if they were next. Mr. Miller had an aide send out the names of those present by e-mail "so that when and if we died, someone would know who was in there."

Somewhere in the havoc of the moment, Richard A. Clarke, then the White House counterterrorism chief, recalled the long drumbeat of warnings about terrorists striking on American soil, many of them delivered and debated in that very room. After a third hijacked jet had sliced into the Pentagon, others heard Mr. Clarke say it first: "This is Al Qaeda."

An extensive review of the nation's antiterrorism efforts shows that for years before Sept. 11, terror experts throughout the government understood the apocalyptic designs of Osama bin Laden. But the top leaders never reacted as if they believed the country was as vulnerable as it proved to be that morning.

Dozens of interviews with current and former officials demonstrate that even as the threat of terrorism mounted through eight years of the Clinton administration and eight months of President Bush, the government did not marshal its full forces against it.

The defensive work of tightening the borders and airport security was studied but never quite completed. And though the White House undertook a covert campaign to kill Mr. bin Laden, the government never mustered the critical mass of political will and on-the-ground intelligence for the kind of offensive against Al Qaeda it unleashed this fall.

The rising threat of the Islamic jihad movement was first detected by United States investigators after the 1993 bombing of the World Trade Center. The inquiry into that attack revealed a weakness in the immigration system used by one of the terrorists, but that hole was never plugged, and it was exploited by one of the Sept. 11 hijackers.

In 1996, a State Department dossier spelled out Mr. bin Laden's operation and his anti-American intentions. And President Bill Clinton's own pollster told him the public would rally behind a war on terrorism. But none was declared.

By 1997, the threat of an Islamic attack on America was so well recognized that an F.B.I. agent warned of it in a public speech. But that same year, a strategy for tightening airline security, proposed by a vice- presidential panel, was largely ignored.

In 2000, after an Algerian was caught coming into the country with explosives, a secret White House review recommended a crackdown on "potential sleeper cells in the United States." That review warned that "the threat of attack remains high" and laid out a plan for fighting terrorism. But most of that plan remained undone.

Last spring, when new threats surfaced, the Bush administration devised a new strategy, which officials said included a striking departure from previous policy — an extensive C.I.A. program to arm the Northern Alliance and other anti-Taliban forces in Afghanistan. That new proposal had wound its way to the desk of the national security adviser, Condoleezza Rice, and was ready to be delivered to the president for final approval on Monday, Sept. 10.

The government's fight against terrorism always seemed to fall short.

The Sept. 11 attack "was a systematic failure of the way this country protects itself," said James Woolsey, a former director of central intelligence. "It's aviation security delegated to the airlines, who did a lousy job. It's a fighter aircraft deployment failure. It's a foreign intelligence collection failure. It's a domestic detection failure. It's a visa and immigration policy failure."

The Clinton administration intensified efforts against Al Qaeda after two United States Embassies in Africa were bombed in 1998. But by then, the terror network had gone global — "Al Qaeda became Starbucks ," said Charles Duelfer, a former State Department official — with cells across Europe, Africa and beyond.

Even so, according to the interviews and documents, the government response to terrorism remained measured, even halting, reflecting the competing interests and judgments involved in fighting an ill-defined foe.

The main weapon in President Clinton's campaign to kill Mr. bin Laden and his lieutenants was cruise missiles, which are fired from thousands of miles away. While that made it difficult to hit Mr. bin Laden as he moved around Afghanistan, the president was reluctant to put American lives at risk.

But a basic problem throughout the fight against terrorism has been the lack of inside information. The C.I.A. was surprised repeatedly by Mr. bin Laden, not so much because it failed to pay attention, but because it lacked sources inside Al Qaeda. There were no precise warnings of impending attacks, and the C.I.A. could not provide an exact location for Mr. bin Laden, which was essential to the objective of killing him.