“That country, and particularly the Afghanistan-Pakistan border, is … where the mujahideen defeated the other superpower,” he said.
“They now have the opportunity to defeat a second superpower, which more than anything would empower their message and the opportunity to recruit and fund raise and plan operations.”
The comments by Gates, a former CIA chief, come as leftists and US foreign-policy critics increasingly call for a US pullout.
Dozens of protesters gathered outside the White House on Monday, and a few were arrested when they chained themselves to the gates.
Seeking to shore up support, Obama has invited senior Democratic and Republican politicians to the White House on Tuesday to discuss the war.
He will meet his national security team to continue the policy review on Wednesday and Friday.
Obama almost doubled the US troop total in Afghanistan to 62,000 to combat the worst violence since US-led forces ousted the Taliban rulers in 2001.
But signing off on the 30,000- to 40,000-troop increase that the top US and Nato commander in Afghanistan, General Stanley McChrystal, is said to have requested would be politically risky for Obama.
Unease within his own Democratic party has been voiced increasingly, as is fatigue among the American public after eight years of war in Afghanistan.