Setting exit dates from conflicts such as Afghanistan "defeats the entire purpose of sending people over there," according to United States Senator John McCain, who said Monday that establishing security is paramount for success in the country.

McCain, who spent the weekend at a security conference in Halifax, told CTV's Canada AM that the primary goal of warfare is "to break the will of the enemy."

However, with the Canadian mission scheduled to end in 2011 and the Dutch and the British threatening to withdraw troops if President Hamid Karzai doesn't take steps to tackle rampant corruption, militants know all they have to do is hang in until the pullout dates.

"If you announce that you're leaving after a certain period of time, then of course you have the opposite effect on the enemy, who decides they'll be there and they'll just hang around until you leave," McCain said. "So the key to it is to devise a successful strategy, implement it, and then as we are in Iraq, go ahead and leave. But setting exit dates and times for withdrawal defeats the entire purpose of sending people over there."

McCain said he "regrets" but "respects" the Canadian government's decision to wrap up the military mission in Afghanistan in 2011.

He also expressed his "appreciation and sorrow" for the sacrifices Canadian soldiers have made in the country.

But while he acknowledged that success in Afghanistan also depends on the eradication of corruption and better economic opportunities for Afghans, he said soldiers are necessary to establish security because without it, "none of the rest of it will work."

While some NATO allies are considering exit strategies, U.S. President Barack Obama is mulling his country's next steps in the region -- including the possibility of a troop surge.

On the one hand, his commander in Afghanistan, Gen. Stanley McChrystal, is calling for tens of thousands more troops to get a handle on security. On the other, his ambassador to Afghanistan, Karl Eikenberry, has expressed strong dissent about a troop surge until Karzai demonstrates he's willing to clamp down on corruption.

According to McCain, success in Afghanistan can come "within a year to a year-and-a-half" if NATO allies establish the right strategy.

"If we provide the security and the training and Karzai understands that he has to address this issue of corruption, we can succeed," McCain said. "But one thing I am sure of is if (we maintain) the status quo...we are going to lose, and we'll have to leave."