U.S. Defense Secretary Leon Panetta, left, picks up a dart during a Maori welcome ceremony at the Government House in Auckland, New Zealand on Sept. 21, 2012. (Larry Downing/AP)

Defense Secretary Leon E. Panetta found himself nose-to-nose with a band of chest-beating Maori warriors Friday, demonstrating the lengths to which the Obama administration is willing to go to bolster its military presence in Asia and the Pacific.

Panetta became the first Pentagon chief to visit this remote Southern Hemisphere nation since Caspar Weinberger in 1982. To do so, he had to pass muster with a fierce-looking honor guard of indigenous warriors who, in an elaborate ceremony, had to determine whether the American qualified as a friend or a foe.

The skirt-wearing Maoris yelled menacingly, flared their noses and stuck out their tongues. One of them then approached a somber-faced Panetta to perform the “hongi,” a ritual clasping of hands and rubbing of noses.

Panetta passed the friendship test. Afterward, leaders of the two countries — once allies but estranged militarily since New Zealand proclaimed itself a nuclear-free zone in the 1980s — pledged to revive their security relationship.

New Zealand has a tiny military, and the rapprochement is unlikely to tilt the regional balance of power. But the opportunity to rub noses was eagerly accepted by the Obama administration, which has been working feverishly to shower attention on just about every country with a Pacific coastline to counter China’s rising influence in the region.

This month, for example, Secretary of State Hillary Rodham Clinton descended on the Cook Islands for a summit of South Pacific nations. Panetta’s trip to New Zealand capped a week-long trip to Asia, his third since becoming defense secretary in July 2011.

Auckland, the largest city in New Zealand, is a long way from Beijing — about 6,400 miles — but the two countries have a free-trade agreement and a friendly military relationship, something that has not gone unnoticed in Washington.

As a result, Panetta pulled out all the stops during his visit here. He met with Defense Minister Jonathan Coleman, held a separate meeting with Foreign Minister Murray McCully and was scheduled to chat Saturday with Prime Minister John Key.

The Pentagon chief effusively thanked New Zealand for sending forces to Afghanistan (it has 180 troops deployed there) and pinned meritorious service medals on five people who served there. He also honored the 10 New Zealanders who have been killed in Afghanistan, laying a wreath in Auckland’s World War II Hall of Memories.

In a reversal of long-standing U.S. policy, Panetta also announced the effective lifting of a 26-year ban on visits by New Zealand’s navy to U.S. bases. The ban was imposed after New Zealand created its nuclear-free zone and prohibited U.S. ships and submarines from visiting its ports unless they declared they were not carrying nuclear weapons, which the Pentagon has refused to do.

In exchange, Panetta received a warm welcome but few concessions. Coleman, the defense minister, said New Zealand had no intention of reciprocating by allowing U.S. ships to visit its bases.

“In terms of our policy, we’ve been clear about our policy, and the U.S. has been very accepting of that,” he said.

Coleman did say that New Zealand was eager to engage in more joint military exercises with U.S. troops and noted that a team of U.S. Marines had visited the country in April. “We welcome the renewed U.S. emphasis on this part of the world,” he said.

For Panetta, that sentiment alone seemed to justify the trip.

“While we acknowledge that our countries continue to have differences of opinion in some limited areas,” he said, “today we have affirmed that we are embarking on a new course in our relationship.”