Gates warned that the lack of troops meant the US had not provided "a baseline level of security" against Taliban forces and he was considering increasing the number of US soldiers.
"Our primary goals should be keep Afghanistan from becoming a base for Al Qaeda attacks on the United States"
US defence secretary
He told politicians that the US could still face "a difficult fight" in the country.
Gates, the only member of the Republican Bush administration to retain a position in the administration of Barack Obama, told the committee that co-ordination with international forces in Afghanistan to combat Taliban fighters had been "less than stellar".
"Too often the whole of these activities has added up to less than the sum of the parts," he said.
Gates' remarks came amid anger in Afghanistan over claims that a US military raid in the eastern Afghanistan province of Laghman at the weekend killed at least 16 civilians.
The US military has denied the claims and said that 15 Taliban fighters died in the operation.
Gates also said that the Pentagon's efforts in Afghanistan would in the future include better counter-insurgency training for US and international forces and efforts to improve "civil-military" co-ordination for reconstruction efforts.
"Our primary goal is to prevent Afghanistan from being used as a base for terrorists and extremists to attack the United States and our allies. And whatever else we
need to do flows from that objective," he said.
"We can attain what I believe should be among our strategic objectives: an Afghan people who do not provide a safe haven for al-Qaeda, reject the rule of the Taliban and support the legitimate government that they elected and in which they have a stake," he said.
|Gates predicted "a long and difficult fight" for the US in Afghanistan [AFP]
Al Jazeera's senior Washington correspondent Rob Reynolds said the goals under Barack Obama, the US president, seem to have changed, becoming less idealistic than the Bush administration.
Obama's strategy appears less about nation-building and more about keeping out al-Qaeda and the Taliban, he said.
The senior US commander in Afghanistan has requested 30,000 more troops deployed to the country to help combat the Taliban.
Obama has vowed to shift military resources from Iraq to Afghanistan and Pakistan, both of which he says form the central front in the struggle against "terrorism".
In his testimony on Tuesday, Gates also praised Pakistan as "a friend and partner" and said any solution to the conflict in Afghanistan required strong US relations with Pakistan, given the porous border between the two Central Asian nations.
Obama last week appointed Richard Holbrooke, a veteran US diplomat, as special envoy to both countries.
Gates' remarks came as Mike Mullen, the head of the US military, called for a regional approach to deal with violence in Afghanistan, including talks with Iran.
"Iran, as a bordering state, plays a role as well, and to the degree that we are able to dialogue with them and find some mutual interests, there is a potential there for moving ahead together but I really leave that to the diplomats," said the Chairman of the US Joint Chiefs of Staff.
"Iran is unhelpful in many, many ways, so I wouldn't be overly optimistic at this point but there are mutual interests that I think might offer some possibilities," he said.
Turning to the war in Iraq, Gates said that although violence remained low there was "still the potential" for setbacks.
He described the prospect of a stable Iraq as "crucial to the Middle East", but warned against looking for a swift resolution to the conflict.
"As our military presence decreases over time, we should still expect to be involved in Iraq on some level for some many years to come," he said.
US forces are currently due to withdraw from major Iraqi cities by the end of June this year and from the country by 2012, as part of a US-Iraq agreement.
The US currently has about 34,000 troops in Afghanistan and around 142,000 troops in Iraq.