Chris Hipkins anticipated a "diplomatic" meeting with Xi Jinping. The Chinese leader said he placed "great importance" on the relationship with New Zealand. Both businesslike, Hipkins made sure to stress his country was open for business too.
And there is certainly a good story to tell when it comes to China. Hipkins is building on decades of cooperation, understanding and ground-breaking economic agreements. Bilateral trade was worth $40 billion in 2022 and could reach $50b by 2030.
There might even be scope for cooperation over China's position on a political settlement of the war in Ukraine. Despite New Zealand and most Western nations being sceptical about the initiative, it is fair to say Chinese authorities would value New Zealand's input.
But it is also fair to say Hipkins was wise to visit now, given what he has coming up in his calendar: The NATO summit in July, and a decision on whether New Zealand should join "pillar two" of the AUKUS security pact between the US, UK and Australia.
Both things will concern China. And despite Beijing's appreciation of New Zealand's diplomatic approach - including Hipkins' reluctance to characterise Xi Jinping as a "dictator" - the timing of this red-carpet visit has been ideal.
Claim and counter-claim
So New Zealand walks a fine line with China, and beneath the diplomatic niceties there is a growing fault line. When Foreign Minister Nanaia Mahuta visited China earlier this year and expressed New Zealand's "deep concerns" over human rights, Hong Kong and Taiwan, some media suggested she had been "harangued" by her Chinese counterpart.
Mahuta has said the conversation was merely "robust", but there is no denying China's combativeness over criticism or threat.
When British Prime Minister Rishi Sunak said China posed "the greatest challenge of our age to global security and prosperity" at May's G7 summit in Japan (which came on top of an official communiqué tacitly focused on China), Beijing hit back at what it called "smears" and "slander".
While not part of the G7, New Zealand later added its name to a "Joint Declaration Against Trade-Related Economic Coercion and Non-Market Policies and Practices" that built on the G7 meeting. Although it did not explicitly mention China, the declaration clearly articulated concerns over Beijing's perceived willingness to use trade sanctions against countries that displease it.
This includes South Korea after it installed a US missile defence system, and Australia after it called for an independent investigation of the origins of Covid-19. More recently, China blocked Lithuanian exports after the tiny nation allowed Taiwan to establish a de-facto embassy there.
When New Zealand joined the US in speaking out over the security agreement between China and the Solomon Islands, Chinese state media accused Wellington of smearing and demonising their country and yielding to the influence of Washington.
A few months later, New Zealand reiterated its position to uphold the rule of international law around China's island-building in the South China Sea. While officially this amounted to not taking sides over competing claims to sovereignty, it effectively rejected China's historic claims to the area.
And quite recently it was revealed a New Zealand frigate was confronted - professionally but visibly - by Chinese naval vessels while in international waters near the disputed Spratly Islands.
Security and circumspection
Closer to home, there have been intermittent skirmishes over cyber-security. In 2018, New Zealand's Government Communications Security Bureau (GCSB) stated it had "established links" between the Chinese Ministry of State Security and a global campaign of commercial intellectual property theft.
New Zealand's Security Intelligence Service (SIS) has also recently noted agents from a "small number of foreign states" were becoming "increasingly aggressive", but chose not to identify the culprits.
But when it was reported an analyst within the Public Service Commission had been suspended after being named an "insider threat risk" by the SIS, the Chinese embassy called the claims "ill-founded, and with an ulterior motive to smear and attack China, which we firmly oppose".
The G7 countries have directly called on China not to interfere in their domestic affairs. New Zealand generally prefers to be circumspect. The SIS has identified foreign states monitoring alleged dissidents in New Zealand, but it does not name those states.
NATO and AUKUS
How long the diplomatic tightrope can be walked is an open question, given the prime minister's forthcoming attendance at the NATO summit in Lithuania in July, and the pending decision on AUKUS.
With its support for Ukraine against Russia, New Zealand has become much closer to NATO, which in 2021 also identified China as a security challenge, saying Beijing's ambitions and its "coercive policies" challenge the Western bloc's "interests, security and values". China called it a "completely futile" warning.
At the same time, of course, New Zealand may be moving closer to involvement in the AUKUS alliance, which would mean access to cutting-edge, non-nuclear military technologies. And while it is never explicit, AUKUS is a response to the perceived threat of China's increasing assertiveness in the Indo-Pacific region.
Despite its own rapid militarisation, the Chinese government has condemned AUKUS as reflecting a "Cold War mentality" that involves a "path of error and danger". However diplomatically it was hedged, the same message will almost certainly have been delivered to Chris Hipkins yesterday in Beijing.
* Alexander Gillespie is a Professor of Law at University of Waikato
This story was originally published by The Conversation.