The United States will probably withdraw from a regional mutual defense treaty if New Zealand formally bans visits by nuclear ships, State Department officials said yesterday.

"The probable result would be termination of the U.S. security obligations to, and the alliance relationship with, New Zealand," the department said in a formal statement. Paul D. Wolfowitz, assistant secretary of State for East Asian and Pacific Affairs, said in an interview with TV New Zealand that the country would also suffer loss of its "influence and access" in Washington on trade matters.

The United States put the 34-year-old Australia-New Zealand-United States (ANZUS) pact on hold last February after New Zealand demanded to know whether a Navy destroyer, the USS Buchanan, carried nuclear arms before allowing it to enter port. Longstanding U.S. policy is to refuse that information on grounds that it would facilitate target selection by U.S. adversaries.

The United States canceled ANZUS exercises, halted intelligence sharing with New Zealand and suspended naval maneuvers in the area to signal its displeasure and to discourage other antinuclear governments from following suit, officials said.

The ship ban was popular with New Zealanders, however, and New Zealand Prime Minister David Lange plans to introduce legislation by mid-December that would give him power to ban any ship's visit if he decides that the vessel is nuclear powered or carries nuclear weapons.

"Should such legislation be enacted, we would have to review our whole commitment to New Zealand under ANZUS," Wolfowitz said, according to a transcript of the interview, which is scheduled for broadcast Dec. 12 in New Zealand. "I think the probable consequence of such a review would be . . . that we are going to have to effectively terminate our alliance commitment to New Zealand."

State Department officials said such a decision would not affect U.S. relations with Australia under the pact, which they described as a trilateral treaty of mutual cooperation and defense in case of an attack on any of the three. "In our judgment New Zealand's proposed law would negate that by not providing help for the collective defense," one official said. The treaty structure would remain in place, but "as far as New Zealand is concerned, our relationship as allies would not exist."

Wolfowitz added that it would be "a mistake to say that there are no consequences outside of the security relationship." New Zealand's access to U.S. military technology and to U.S. officials for help with trade problems would end, he said, although he emphasized that there would be no formal economic sanctions.

"There is a degree of influence and access that goes with having the status of being a good and valued ally," he said. "That situation is different now."

Talks between U.S. and New Zealand officials on the terms of Lange's proposed legislation have broken down, Wolfowitz indicated. Another official said the United States would accept a measure giving the prime minister authority to bar ships, but only if the criteria did not label all vessels by nuclear status.

Other U.S. allies that bar nuclear weapons in their territory allow U.S. ships to visit and do not ask whether they carry such arms.

Wolfowitz said the U.S. position provides "an important degree of ambiguity" in the known nuclear status of all U.S. ships. "We don't think on an issue that important that we should give the Soviet Union any unnecessary help," he said.