Anger has been mounting in the country over a surge of civilian deaths from military operations.
Gates' visit comes weeks after a US-led coalition air strike in western Herat province. Both the Afghan government and the United Nations say the attack killed more than 90 civilians, mostly women and children.
The U.S. military said 30 to 35 militants were killed, but it plans to reopen an investigation after cellphone video emerged showing bodies of people said to have been killed in the strike.
Gates visited Bagram airfield, the main US military base in Afghanistan north of the capital. After meeting and talking with US soldiers, Gates offered his condolences for civilians killed in the air strikes.
Robert Gates said, "I think the key for us is, on those rare occasions when we do make a mistake, when there is an error, is to apologize quickly, to compensate the victims quickly and then carry out the investigation. That's the approach we have had in Iraq and I think we need to move to that here."
In the first seven months of this year, at least 119
Afghan civilians have been killed in air strikes, most in US-led coalition raids.
(CCTV September 19, 2008)