Updated

When Anders Fogh Rasmussen took over at NATO, the alliance was struggling to contain a growing insurgency in Afghanistan, and some predicted it would soon follow its Cold War foe, the Soviet-led Warsaw Pact, into the dustbin of history.

Five years later, as Rasmussen wraps up his tenure as the 12th secretary general in NATO's history, the U.S., Canada and their European allies are again squaring off against the Russians, and must confront a more diverse and bewildering array of threats to Western security than ever.

"We should be prepared to address all of them, whether it is a conventional threat against our territory, or what I would call hybrid warfare as we have seen in Ukraine — a sophisticated Russian mix of conventional military operations and information and disinformation campaigns — or terrorism as we see it in Iraq, or cyber-attacks or missile attacks," Rasmussen told The Associated Press in a farewell interview.

"All this is part of today's security environment and NATO must stand ready to protect our societies and our populations against all those threats," said Rasmussen.

The 61-year-old Dane's last day as the U.S.-led defense alliance's top civilian official is Sept. 30. In one of his last official acts, he was scheduled to deliver a speech at the U.S. Military Academy at West Point on Tuesday.

On Rasmussen's watch, NATO continued to wage what has been the longest and most extensive military operation in its 65-year history in Afghanistan, a campaign that is supposed to come to an end this December.

"Rasmussen played a valuable role in helping convince NATO members to contribute additional forces to President Barack Obama's surge strategy," said Jorge Benitez, senior fellow for trans-Atlantic security at the Washington, D.C.-based Brent Scowcroft Center on International Security. "This was a major accomplishment because the momentum had been for allies to decrease their commitments in Afghanistan."

Rasmussen, a former center-right prime minister of Denmark, was also in charge when NATO provided air cover to the rebel militias that brought down Libyan dictator Moammar Gaddafi.

An important lesson he drew from that conflict and the ensuing chaos, Rasmussen told AP, was that the international community must get involved faster when a repressive regime is overthrown, in order to improve the chances for a desirable and stable outcome.

Earlier this year, when Russian's military occupied and annexed Crimea, then began what the Western governments called a "stealth invasion" of eastern Ukraine, Rasmussen loudly and repeatedly voiced his outrage — and worked hard in public and behind the scenes to help forge trans-Atlantic unity and an effective and credible military response.

Europe's most acute geopolitical crisis since the demise of the Soviet Union was a reminder that NATO's original mission — defense of its own members against Russian aggression — was still urgently relevant, and Rasmussen rose to the challenge, one Dutch analyst said.

"He took the opportunity to put NATO on the map," said Margriet Drent, senior research fellow at the Netherlands Institute of International Relations. "Until then, 25 years after the fall of the Berlin Wall, NATO was still looking for its purpose."

It may take time to determine the ultimate effectiveness of many changes enacted during the Rasmussen years. These include the alliance's new "strategic concept," or mission statement, approved in 2010, and the "smart defense" initiative to foster greater cooperation among the 28 NATO member countries in acquiring and using military capabilities.

Similarly, it is difficult to predict the future of Afghanistan, where a 13-year-old war against the Taliban continues and two rival candidates for the nation's presidency have just reached a power-sharing agreement. Some have also questioned whether NATO has done enough to discourage the expansionist ambitions of Russian President Vladimir Putin.

Rasmussen told AP he has no regrets.

"We have reformed our alliance, streamlined structures, so all in all it's fair to say we have cut fat and built muscle during my tenure as secretary general," he said. "And I hope and I trust it will be remembered for some years."

He will be succeeded at NATO by a former Norwegian prime minister, Jens Stoltenberg, who takes office Oct. 1. To achieve a seamless transition, he and Rasmussen have been talking by phone — as Scandinavians, they understand each other's language — and alliance officials have been flying to Oslo to bring Stoltenberg up to speed.

Earlier this month, Obama and the other NATO heads of state and government met in Wales, and issued an ambitious to-do list for the alliance that took up a large part of their 24-page Summit Declaration. On the list is a Readiness Action Plan meant to reinforce the defenses of alliance members in central and eastern Europe skittish about Putin's intentions, and to deter any hostile moves by the Kremlin.

A key component of the plan is creation of a highly mobile multinational "spearhead" force that could be sent at short notice to Poland, the Baltic states or any other NATO member at risk. Implementing the Readiness Action Plan "will be the first very important issue for Mr. Stoltenberg," said Rasmussen.