In a historic trip replete with bear hugs, red carpets, selfies and smiles, the Greek prime minister has attempted to bury the hatchet with the newly named North Macedonia, declaring the start of a new “narrative” between the once-hostile neighbouring states.

Making the first official visit by a Greek premier to the former Yugoslav republic since it declared independence in 1991, Alexis Tsipras arrived in Skopje two months after the Athens parliament ratified a landmark accord that changed the name of the Balkan country, which was previously known as the Former Yugoslav Republic of Macedonia.

From the outset it was friendship – and the economy – that set the tone of Tsipras’s visit.

“We are here to build bridges and break down walls,” Tsipras announced at a joint press conference held alongside his counterpart, Zoran Zaev. “This is a historic moment not only for our countries, but for the Balkans and Europe.”

After almost 30 years of division, the two nations needed to move fast “to cover lost ground”, he said. Walking into Skopje’s main government building, the men posed for selfies amid spontaneous applause from politicians around them.

Under a pact signed last summer, the republic agreed to add the geographical qualifier “North” to its name to appease longstanding fears in Athens of territorial claims over the region of Macedonia in northern Greece.

“This agreement is an example to be mimicked by all,” said Zaev, hailing the one-day visit as a historic milestone.

“We showed Europe and the world that with bold decisions anything is possible … Greece is our friend now, she will remain our friend and will become an even greater friend in the future.”

But while the accord received widespread praise abroad – welcomed as a rare feelgood moment for Europe – it has enraged nationalists in both countries.

Emotion has run especially high in areas of northern Greece bordering North Macedonia, where opponents have accused Tsipras’s government of betrayal.

With both leaders facing elections this year – North Macedonia holds presidential polls on 21 April, while Greece will have general elections by October at the latest – the emphasis was on the benefits the two countries stand to gain from a deal that has helped to reshape the once war-torn Balkan peninsula.

Before the accord was brokered, Greece had vetoed its northern neighbour’s bid to launch membership talks with both Nato and the European Union – a move that had frustrated western leaders concerned by perceived Russian meddling in the strategically important region.

Tsipras and Zaev pose for the cameras. Photograph: Eurokinissi/Rex/Shutterstock

In a day of fence-building, the focus was on consolidating ties in concrete ways. As part of a national action plan, discussed in the first high-level cooperation council during the visit, everything from civil aviation to digital policy and the rewording of history books was broached.

“For years, every time I would go to Europe with the government aircraft ... I noticed that the pilot made a deviation so it wouldn’t enter the airspace of FYROM [Former Yugoslav Republic Macedonia],” said Tsipras. “This silly behaviour now stops ... Not only won’t we make deviations, but we might also take a stroll to say hello.”

Ten cabinet ministers, accompanying Tsipras on the trip, signed a slew of deals in the fields of economy, defence, infrastructure and transport. Tsipras also announced that Greece would move immediately to establish an embassy in Skopje.

“Soon, even those who oppose [the deal] will begin to see its positive effects,” said Zaev, who before the visit said he expected new Greek investments in North Macedonia to exceed €500m (£430m).

In recognition of the deal, Zaev and Tsipras have been nominated for this year’s Nobel peace prize.

But while insisting that a lot had been achieved in a remarkably short time, Tsipras conceded that the agreement – which gives North Macedonia five years to change its name at home and abroad – would almost certainly “be tested in critical areas as time goes by”.

Among Greek critics’ greatest grievances is the theft of ancient figures, not least the Macedonian hero, Alexander the Great, by the Balkan state.

In a nod to them, Tsipras said that while ancient Greek culture was “universal”, he looked forward to a time when the origins and inspiration behind the plethora of statues and monuments around Skopje was finally made clear.