Robert Gates speaking at TD's Orlando conference on Thursday.

Former Defense Secretary Robert Gates opened his keynote speech at the TD Ameritrade annual conference Thursday in Orlando with a series of rapid-fire one-liners worthy of Henny Youngman. The target? Inside-the-Beltway Washington politics.

“It’s a pleasure to be here in Orlando,” Gates, whose long D.C. tenure includes a stint as CIA director from which he retired in 1993, said. “Actually it’s a pleasure to be anywhere but Washington, D.C.”

He then quoted President John F. Kennedy by saying, “It’s a city of southern efficiency and northern charm.”

“Politicians have biblical levels of self-regard,” he continued. “People there are always lost in thought because it’s such unfamiliar territory. They walk down Lovers’ Lane holding their own hand. They say they’ll double cross that bridge when they come to it.’”

His obvious disdain for the powerbroker political elite then took a serious turn. Calling himself the “Eeyore of the national security community,” he identified a number of foreign-policy hotspots that clearly have him worried.

“Our focus is usually on the daily headlines in the U.S.,” he said. “But as we do that, the world marches on.”

When Gates retired in 1993, the United States had just won the Cold War and was the only remaining super power. Regulators had just cleaned up the savings and loan crisis and the country was on a sustained path of economic growth that culminated in a budget surplus by the end of the decade.

But there were foreign policy warnings of bigger challenges to come, Gates said. Resentment and chaos in Russia led future Prime Minister Vladimir Putin to remark that the fall of the Soviet Union was the worst event of the 20th century. China saw the Soviet Union’s collapse as an opportunity to uncover and exploit our military weaknesses. And there were the first attacks by al-Qaida on the World Trade Center, as well as American embassies in Africa.

“The death of Osama bin Laden was obviously a great victory in the war on terror,” Gates said. “Al-Qaida is now on its heels. But what we’re seeing now are more attacks by disaffected young men both here and abroad, as the Ft. Hood shooter illustrates.”

We’ve been lucky, Gates added, because a number of attacks have failed recently, that, had they been successful, could have done great damage.

“We can no more eliminate the risk of terror that we can eliminate crime,” he said. “We can reduce the risk, but not completely eliminate, especially in a free and open society of 300 million people. What we must do is fight the battle on their 10-yard line, not our 10-yard line, or worse, our end zone.”

The war in Afghanistan was critical to reducing the threat of terrorism, but Gates lamented the “divergence of resources to Iraq in 2003” which he said “clearly hurt” the effort.

“Despite the frustration over Afghanistan, that cannot lead to a premature exit,” he said.

He then took on the issue of America’s relationship with Pakistan, which he also called frustrating, especially in light of the fact that after the death of bin Laden, the investigations were not into who might have assisted bin Laden in “hiding in plain sight,” but rather on who might have helped the Navy Seals with intelligence gathering.

“There is a deficit of trust in that relationship, but we should not abandon it,” he said.

He called Iraq “the most costly and controversial campaign of the post-9/11 theater,” and added that in his opinion, the United States should have kept a small force in behind to help keep the country stable.

“As a sovereign country, they chose not to renegotiate the terms agreed to under the Bush Administration,” he explained. “[The Iraq War] will always be tainted by how and why it was launched, but we don’t get any do-overs. We have to protect what we accomplished and America’s interests in the region.”

The strong showing of the Muslim Brotherhood in recent elections in Egypt are not encouraging, he said, noting that non-governmental organizations sent to monitor the voting are routinely harassed and representatives of one NGO that includes the son of the transportation secretary are now being detained.

“One free election will not do,” Gates said. “You have to have a build-up of democratic institutions, the rule of law and civil liberties. No Arab state currently possesses the building blocks.”

The unpopularity of the United States and the general loathing of Israel by the Arab public must be reckoned with. Unfortunately, this creates more problems than opportunities, he  added.

“The tectonic plates in the Middle East have shattered,” he warned. “Remember that only one revolution turned out relatively well in its first decade, and that is our own.”

Turning to Iran, he noted their pursuit of nuclear weapons, recent action in the Strait of Hormuz and the “amateurish” attempt to assassinate a Saudi ambassador in a Washington restaurant.

“We must continue to ratchet up the diplomatic and economic isolation; it is the best hope and appears to be working,” he said. “We should not attack them militarily. They have a population that is increasingly disaffected. Attacking them would only rally the public behind the government.”

Concluding with China, the former defense secretary said, ”We must deal with the national security implications of China’s growing wealth.”

He noted the $3 trillion recently spent on updating the military, which could alter the balance of power in the Pacific. They also have an insatiable appetite for oil and energy, and are scouring the globe in its search.

“They’re a growing power, so why are they so paranoid?” Gates asked. “Because the government’s only legitimacy is in a steadily growing economy. As that begins to wane, they are increasingly turning to nationalism to protect their exaggerated territorial claims, like in the South China Sea for instance.”

However, we must not treat them as an enemy, Gates advised.

“If we treat them as an enemy, they will surely become one.”

Read full coverage of TD Ameritrade’s conference at AdvisorOne.