In front of the world's cameras, Yemeni rivals smiled too, shaking hands, with a bit of help, from the UN chief.
''I told the UN Secretary General there is no need for him to help bring us closer," Yemen's Foreign Minister Khalid al-Yamany later posted on his Twitter account about this crucial clasp. ''This is my brother, despite his coup against the state, and the destruction of the homeland which caused this human tragedy.''
As 2018 drew to a close, the image of a Yemeni government minister and a senior Houthi official shaking hands on a deal, which included a surprising ceasefire in the strategic port city of Hudaydah, shot like an electric current around the world.
The process, led by the UN's third Yemen envoy Martin Griffiths, marked the most significant breakthrough in five years of talks.
''Have you seen the video of the handshake?'' exclaimed a Yemeni friend, who added a bright happy emoji to her post sent on the WhatsApp messaging service.
Congratulatory statements cascaded from a multitude of aid agencies who'd been sounding the alarm for months about the world's worst humanitarian crisis becoming, unimaginably, even worse.
But behind this Swedish moment, which provoked a rare hashtag of #Hope on social media, lies deep distrust. It still keeps warring sides and their backers a long way from peace.
No sooner did the talks end, the Houthis described the Yemeni government as the ''UAE-Saudi controlled delegation.'' And Yemeni government officials privately accused their rivals aligned with Iran of negotiating in bad faith.
The "immediate ceasefire'' in Hudaydah was soon broken. The truce is now largely holding, but imperfectly so, with each side accusing the other of violating it. No one expects it to be smooth, simple, or straightforward.
The news from Sweden was exceptionally good. In part, that's because any news from Yemen has been extraordinarily bad.
It happened because of a new international focus on Yemen's dire plight. It was present inside the sprawling Swedish castle and on phone lines to capitals which can make all the difference on the battlefield.
''We were blessed,'' a senior UN official tells me with palpable relief.
And discussions between Yemeni enemies brought them a bit closer. ''We ate together, talked together, and we created a bit of warmth by sharing jokes about the cold weather,'' a member of the Yemeni government delegation explains.
Other breakthroughs included the mechanics of a mass prisoner exchange which, if implemented, will bring joy and relief to thousands of families. An ''understanding'' was also reached to discuss a punishing siege on the south-western city of Taiz.
But, as Peter Salisbury of the International Crisis Group points out, the agreements reached in Stockholm "reflect a strong humanitarian impulse rather than strategic calculations." There was no consensus in Stockholm on the parameters of a road map towards peace.
The UK's Foreign Secretary Jeremy Hunt admits that while "there was light at the end of the tunnel, Yemen was still very much in the tunnel.''
The political wrangling at the UN Security Council over the resolution passed to underpin the agreements was all too familiar.
Iran's involvement in this conflict continues to be the principle preoccupation of the Saudi-led coalition. "The US administration clearly sees the Iran dimension," an Arab foreign minister emphasises with satisfaction.
A major litmus test will be the critical ceasefire in the port city of Hudaydah, the vital lifeline for humanitarian aid which helps feed nearly two-thirds of Yemen's population.
A United Nations Redeployment Committee is now on the ground, headed by a UN military expert, the former Dutch general Patrick Cammaert, and includes members from the warring sides.
The language in this imperfect last-minute deal was necessarily vague. It's already being interpreted in conflicting ways.
The agreement says ''local security forces'' will assume control once the Houthis pull out of the main port as well as two others, followed by a ''mutual withdrawal'' of Houthi fighters as well as pro-government forces now massed just a few miles outside Hudaydah.
Houthi officials are insisting some of their forces and civil servants will fill the vacuum. The Yemeni government is making clear it wants its own ministries to take charge.
Discussions are also underway in countries not directly involved in this conflict about providing observers for a de-militarised zone around this strategic area.
"The establishment of a ceasefire in Hudaydah is a crucial first step toward averting outright famine in Yemen and perhaps even toward ending the war," says Joost Hiltermann of the International Crisis Group, "yet the good intentions of the fighting parties should not be taken for granted."
"This is why it is critical that there be a strong UN-led monitoring mechanism with full international backing. In Yemen's war, there are spoilers galore." he says.
Other eyes will be on this too.
''The Americans have given us guarantees they will use their satellite technology to ensure the Houthi withdrawal takes place,'' an Arab official in the Saudi-led coalition tells me.
Enhanced US engagement in this process has been pivotal. The murder of journalist Jamal Khashoggi in the Saudi consulate in Istanbul on 2 October has concentrated minds in Washington on its relationship with the kingdom, including its military support in Yemen.
As anger mounted in the US Congress, both Secretary of State Mike Pompeo and Secretary of Defence Jim Mattis called for a ceasefire and a commitment to the Stockholm process.
Then, in the last 36 hours of talks, Secretary Mattis and other senior officials were on the phone to the Saudi and Emirati capitals.
What had been a growing sense that a major assault on Hudaydah was all but inevitable shifted to a new focus on a truce.
"The Saudi Crown Prince, Mohammed bin Salman, intervened personally at least three times to put pressure on the Yemeni government delegation,'' one Western source disclosed about the involvement of the kingdom's de facto ruler, who is regarded as the architect of its war in Yemen.
On the ground, the UAE-led forces around Hudaydah had all but encircled this coveted stretch of land on the Red Sea coast.
But the UAE knew what could be next - months of bloody street-to-street fighting against well-entrenched Houthi fighters and horrific headlines which would intensify outrage in the new US Congress and beyond over the human cost of this conflict.
"The ceasefire isn't the same as a knockout blow but it's definitely the next best thing," an Arab diplomat in the coalition tells me.
And, rather hopefully, he adds, "this will now be a Yemeni process which takes pressure off the coalition."
Observers believe the Houthis also knew it was only a matter of time before they lost Hudaydah militarily. The ceasefire also offered them a way out.
The next round of talks, set for late January, will be tougher. Yemen's year ends with less pessimism, even if a new one is certain to start with more surprises as well as setbacks.