WASHINGTON (CNN) -- Former GOP presidential nominee John McCain warned Wednesday that the United States is losing the war in Afghanistan.

Sen. John McCain recommended expanding the Afghan army to between 160,000 and 200,000 troops.

The Arizona senator, the ranking Republican on the Senate Armed Services Committee, said that while he approved of President Obama's recent decision to send 17,000 more troops to the country, he believed an additional allied military and civilian surge would be necessary to prevent it from once again becoming an al Qaeda safe haven.

The Obama administration is conducting a review of overall U.S. policy in the troubled Islamic republic, the president said in his joint address to Congress on Tuesday.

"With our friends and allies, we will forge a new and comprehensive strategy for Afghanistan and Pakistan to defeat al Qaeda and combat extremism," Obama said Tuesday. "Because I will not allow terrorists to plot against the American people from safe havens halfway around the world. We will not allow it."

But McCain said on Wednesday, "When you aren't winning in this kind of war, you are losing. And, in Afghanistan today, we are not winning." He delivered his remarks at the American Enterprise Institute, a Washington-based think tank.

McCain claimed that while the situation in Afghanistan is "nowhere near as dire as it was in Iraq," the number of insurgent attacks had spiked in 2008 and violence had increased more than 500 percent in the past four years.

Growing portions of the country "suffer under the influence of the Taliban," he added.

McCain's comments echoed those of Defense Secretary Robert Gates, who acknowledged last Friday that the United States is facing a "very tough test" in Afghanistan.

"But I'm sure we will rise to the occasion the way we have many times before," Gates told a news conference in Krakow, Poland, where NATO defense ministers were meeting.

McCain said that the U.S. was winning the war in Afghanistan through early 2005, when some troops were withdrawn and "our integrated civil-military command structure was disassembled and replaced by a Balkanized and dysfunctional arrangement."

A Vietnam War veteran, former prisoner of war and longtime member of the Armed Services Committee, McCain said that while he knows Americans "are weary of war ... we must win [in Afghanistan]. The alternative is to risk that country's return to its previous function as a terrorist sanctuary, from which al Qaeda could train and plan attacks against America."

Among other things, McCain stated that the U.S. needs to establish a larger military headquarters capable of executing "the necessary planning and coordination for a nationwide counterinsurgency campaign."

He also said plans to expand the Afghan army from 68,000 to 134,000 troops were insufficient. He recommended expanding the Afghan army to between 160,000 and 200,000 troops.

At the same time, he said, the U.S. needs to boost the country's nonmilitary assistance to help strengthen "its [civilian] institutions, the rule of law, and the economy in order to provide a sustainable alternative to the drug trade."

Southern Afghanistan provides about two thirds of the world's opium and heroin. Over the years, those two drugs have served as a major source of revenue for the insurgency, including the Taliban.

McCain warned that, even if his recommendations are adopted, the violence in Afghanistan is "likely to get worse before it gets better. The scale of resources required to prevail will be enormous."

The timetable, he concluded, "will be measured in years, not months."

All About Afghanistan War • Afghanistan • John McCain • Barack Obama