CIA director George Tenet has denied that the Bush administration underestimated the threat from al-Qaeda before the 11 September attacks.
Tenet said he had no prior warning of 9/11
Mr Tenet said he had worked with both the Clinton and Bush administrations to try to tackle the danger.
"Clearly there was no lack of care or focus in the face of one of the greatest dangers our country has ever faced," he said.
Mr Tenet was giving testimony before a commission looking into the attacks.
Later, it will hear from a former US official, Richard Clarke, who has strongly criticised President George Bush's handling of the al-Qaeda threat.
CIA director George Tenet
Former US national security adviser Samuel Berger
Former US national counter-terrorism co-ordinator Richard Clarke
Mr Tenet said that despite intense efforts by his agency to tackle al-Qaeda, the CIA had no prior warning of the 11 September plot:
"We didn't steal the secret that told us what the plot was," he said. "We didn't recruit the right people or technically collect the data, notwithstanding enormous efforts to do so."
He said both the Clinton and Bush administrations took the threat of terrorism seriously, but that the country was not "systemically protected".
"The most important systemic lesson from all this, is that for a period in the '90s we raced from threat to threat...But the country was not systemically protected, because there was not a system in place saying you gotta go back and do this and this and this."
Mr Tenet said a special unit was set up track Osama Bin Laden in 1996, under Bill Clinton's presidency.
The US had first become aware of Bin Laden in the early 1990s, he said, while the al-Qaeda leader was living in Sudan.
When Bin Laden moved to Afghanistan in 1996, the CIA set up a "dedicated component with a mission of disrupting his operations".
In 1999, in an operation known as 'The Plan', the CIA set up a network of agents in Afghanistan to counter Bin Laden.
"We disrupted terrorist attacks that saved lives. There were actions in 50 countries, involving dozens of suspects, many of who were followed, arrested or detained," Mr Tenet said.
During the summer of 2001, which Mr Tenet said was an "intense period", there were arrests or detentions in Bahrain, Yemen and Turkey.
"We halted, disrupted or uncovered weapons caches and plans to attack US diplomatic facilities in the Middle East and Europe," he said.
"But despite these efforts we did not penetrate the plot that led to the murder of 3,000 men and women" on 11 September, he said.
Mr Tenet acknowledged that US intelligence agencies needed to improve their performance.
"We need to have a... seamless flow of data from intelligence community to law enforcement community, so there is never the assertion that 'I didn't see this piece of information, it could've saved lives,'" he said.
"Probably we had a lot of data that we didn't know about."
Later on Wednesday, former anti-terror aide Richard Clarke will get a chance to explain allegations he has made in a book that Mr Bush ignored warnings before the attacks.
On Tuesday Mr Bush strongly rejected the allegations, saying he would have acted if he had had prior knowledge.
Mr Clarke has alleged that Mr Bush was too focused on Iraq to take the al-Qaeda threat seriously.
The BBC's Justin Webb in Washington says there has been no let up in the White House campaign to denigrate Mr Clarke and cast doubt on his motives.
Investigating US policy before, and response after 9/11 attacks
Bipartisan: Five Democrats, five Republicans
Set up by Congress, Nov 2002
Eight public hearings so far, three more to go
President Bush to meet privately with panel leaders
To report findings on 26 July
Mr Clarke served as head of counter-terrorism under four consecutive US presidents, from Ronald Reagan to George W Bush.
This is the eighth public hearing held by the bi-partisan commission, established in 2002.
The hearings are on "the formulation and conduct of US counter-terrorism policy".
In a preliminary report on its findings so far, the commission said the Clinton and Bush administrations were too slow in moving away from diplomatic pressure to direct military action as a way of dealing with the al-Qaeda leadership.