SYDNEY - In 2008, New Zealand's then Prime Minister Helen Clark visited the Great Hall of the People in Beijing, where she attended a signing ceremony to mark a free trade deal between the two countries - the first such deal between China and a developed nation.
The deal, she told reporters, was "just the beginning".
Nine years later, New Zealand signed an agreement to join China's Belt and Road Initiative, becoming the first Western country to join the globe-spanning, infrastructure-building scheme. It was also the first Western nation to join talks to set up the China-led Asian Infrastructure Investment Bank, founded in 2016.
These moves helped to cement New Zealand's reputation as being relatively pro-China and unashamedly willing to openly embrace the potential benefits of China's rise.
But Wellington's stance is quickly changing.
It has increasingly been taking a harder line against Beijing, particularly over concerns about China's growing influence in the Pacific.
In 2018, New Zealand followed Australia's move in blocking Chinese telecommunications firm Huawei from supplying equipment to its 5G mobile network. Two years later, New Zealand suspended an extradition treaty with Hong Kong over concerns that China's imposition of a national security law meant that Hong Kong's justice system was not sufficiently independent from China's.
But New Zealand's growing view that China's rise presents a threat - not merely an opportunity - was made explicit in the country's 2021 Defence Assessment, released earlier this month. Such assessments are released roughly every five years.
The new 36-page report reached sobering conclusions about the threat from China, warning that "an increasingly powerful China is more assertively pursuing its interests".
"Beijing is seeking to reshape the international system to make it more compatible with China's governance model and national values, and with China recognised as a global leader," it said.
Traditionally, New Zealand, unlike Australia, has tended to try to distance itself from great power competition and to adopt a foreign policy that is more independent of its close friend, the United States.
But the report suggested that Wellington believes that the security threat from China is increasingly close to home.
In particular, New Zealand, which celebrates its identity as a Pacific nation and its ties to its Pacific island neighbours, warned that Beijing is seeking to boost its military ties in the region.
Without naming China, the report said that one of the most threatening developments affecting New Zealand's security would be "the establishment of a military base or dual-use facility in the Pacific by a state that does not share New Zealand's values and security interests".
"Such a development would fundamentally alter the strategic balance of the region," it said.
Analysts said the report confirmed that New Zealand was growing wary of China, its closest trading partner, and that its regional outlook was increasingly close to that of Canberra and Washington.
An expert on Chinese foreign policy, Professor Anne-Marie Brady, from the University of Canterbury, said the defence assessment will "really poke the panda" and will end any perception in Australia that New Zealand has been too timid towards China.
Prof Brady wrote in The Sydney Morning Herald that New Zealand government analyses in the past three years "quietly" warned about the threat from China's expanding interests in the Pacific, but they were typically redacted to avoid provoking a strong response from Beijing.
In contrast, she said, the 2021 assessment "breaks new ground by finally saying the quiet parts out loud: New Zealand, like Australia, regards China as an adversary and strategic competitor to New Zealand's national interests".
Another analyst, Mr Geoffrey Miller, described the assessment as hawkish and "unusually forthright", saying on the Democracy Project website that it "comfortably put New Zealand on the same page as Australia and the US".
As Mr Miller noted, New Zealand does still try at times to adopt a more balanced - or ambiguous - approach towards China. But such a position is becoming harder to sustain as tensions in the region rise.
"The stakes are getting higher and higher," he wrote. "There is no guarantee that the same game plan will succeed in 2022."
New Zealand Prime Minister Jacinda Ardern appears to be keenly aware of this dilemma. In a speech in May, she noted that the country was finding it "harder to reconcile" differences with China over issues such as human rights.
"Areas of difference need not define a relationship," she said. "But equally, they are part and parcel of New Zealand staying true to who we are as a nation."