New Zealand will send a six-member Defence Force team to help protect shipping in the Red Sea from Houthi attacks.
Prime Minister Christopher Luxon, Foreign Minister Winston Peters and Defence Minister Judith Collins confirmed the plan after Tuesday's Cabinet meeting, the first of the year.
They said no ships would enter Yemen.
In a joint statement, Luxon said the deployment was a "continuation of New Zealand's long history of defending freedom of navigation both in the Middle East and closer to home".
Luxon said the Houthi attacks were hurting exporters.
"Nearly 15 percent of global trade goes through the Red Sea, and the Houthi attacks are driving costs higher for New Zealanders and causing delays to shipments," Luxon said.
"The Houthi attacks are illegal, they're unacceptable and they're profoundly destabilising. And we and our partners have made repeated calls for them to stop. The Houthi choose to defy those warnings, and indeed their attacks become even more indiscriminate."
It was a "logical consequence" New Zealand joined international partners in this, Luxon said.
The personnel were being deployed at this point no later than 31 July and will be part of a coalition of like-minded partners who will be working together as a team, he said.
"We think we've got it right-sized, we think we've got a proportionate response, we think that the personnel that we're sending will add tremendous value and capability to the coalition and we think we've got it right."
Peters said the decision should not be conflated with New Zealand's position on the Israel-Gaza conflict.
"These efforts support international security and the free flow of trade on which New Zealanders rely," he said.
"It also impacts the cost of living here ... this piracy threatens the hundreds of millions of innocent consumers worldwide."
He said the attacks also threatened the international rules-based order.
"Any suggestion our ongoing support for maritime security in the Middle East is connected to recent developments in Israel and the Gaza Strip, is wrong. We are contributing to this military action for the same reason New Zealand has sent defence personnel to the Middle East for decades - we care deeply about regional security because our economic and strategic interests depend on it."
Luxon said "conflating the two issues is very unhelpful".
"This is about Houthis taking action indiscriminately on commercial ships that actually are impacting the world and causing a lot of pain and suffering around the world."
Asked if he thought this action will increase or decrease the threat level for New Zealanders travelling in the world, Luxon said: "we don't know that".
Peters said the Opposition was not consulted "because it was a position that they'd already evidenced themselves, some time back, on these matters in some of the statements they've made".
"It being a limited engagement ... we did not think it was required for us to do that."
Collins said the Houthi attacks showed a disregard for international law, peace and stability, and the coalition response was an inevitable consequence of their actions.
"New Zealand supports global stability and this deployment shows our commitment to efforts to address a serious threat to that stability."
The Defence Force personnel would not go into Yemen, but would hold a number of roles at operational headquarters, she said.
"Our New Zealand Defence Force personnel are immensely skilled, they signed up to defend New Zealand and they're trained to do it. They're ready to do our bit and I'm extremely proud of them."
The operation will be targeted, based on intelligence and other information of that nature, and would not be in combat, she said.
"That's all I can really say on the matter. They'll be there to provide the targeting, and precision targeting, they're not there to be involved in combat."
'Horrified' by decision
The Green Party said it was "deeply disturbed" by the decision and would be seeking an urgent debate on the issue as soon as possible.
In a statement, Green Party co-leaders James Shaw and Marama Davidson said Aotearoa had a proud history of being a voice for peace on the global stage.
"Now more than ever we need that voice to be loud and strong - and our actions to be focused on de-escalation of violence, not fuelling further conflict where ordinary people will be affected most.
"We are horrified at this government's decision to further inflame tensions in the Middle East by sending New Zealand Defence Force personnel to the Red Sea."
There was a regional power play between different state and non-state groups in the Middle East and the government's decision would likely inflame tensions, they said.
"It seems inconceivable for this government to be so dangerously naïve to say that this deployment has nothing to do with the horrific violence that continues to suffocate Gaza. The government should be using every opportunity to push for a permanent ceasefire in Gaza.
"When the US asks us to support their military operation, questions need to be asked about the strategic interests the US is prioritising and whether these align with the clear support of the New Zealand people for our defence force to be focused on peace-building and enduring justice."