Ukrainian President Petro Poroshenko has met with his Serbian counterpart in a bid to repair ties with the Balkan country, a key Russian ally in Europe, as both states seek to join the European Union.

The two countries' delegations signed bilateral deals and predicted better ties in the future after a day of meetings in Belgrade on July 3.

The rapprochement was unusual because of a history of differences between the two countries, particularly with regard to Russia.

Serbia, a close Moscow ally, has not joined Western sanctions imposed against Russia over its 2014 annexation of Ukraine's Crimean Peninsula. But the Serbian delegation pointed out that Belgrade had refrained from recognizing that land grab as legal.

A serious dispute also broke out in recent years over Serbian "volunteers" who joined Russia-backed separatists battling against Kyiv's forces in eastern Ukraine. Kyiv last year accused Belgrade of not moving aggressively enough to prosecute such "volunteers."

The conflict in eastern Ukraine has killed more than 10,300 people since 2014.

In light of these differences, both Poroshenko and Serbian President Aleksandar Vucic made a point of saying at their meeting that they respected each other's territorial integrity. And they said they wanted to help each other's efforts at gaining EU membership.

Vucic said that "Ukraine supports the territorial integrity of Serbia, the same way Serbia supports the territorial integrity of Ukraine."

"Serbia and Ukraine have no open bilateral issues and consider each other as exceptionally friendly nations," Vucic said.

Poroshenko said that "we in Kyiv are making all the efforts to restore Ukrainian sovereignty at all occupied territories."

Referring to Serbia's territorial dispute with Kosovo, which declared independence in 2008 despite Serbian opposition, Poroshenko urged a solution that is acceptable to both sides.

"We have not recognized Kosovo and our position is that the Kosovo problem should be solved in a compromise that would respect the interests of Serbia," he said.

While Serbia has not recognized Kosovo's independence, 116 other countries have.

Serbia and Kosovo must resolve their territorial dispute to advance toward EU membership. Serbia has relied on Russia's backing in international forums such as the United Nations in its bid to maintain a claim on the territory.

While Poroshenko and Vucic touted the countries' friendly relations, some commentators saw a subtle sign of tensions when Vucic did not meet Poroshenko at the Belgrade airport for his arrival on July 2.

Poroshenko and Vucic recently attended in Turkey the inauguration of a key pipeline carrying natural gas from Azerbaijan's gas fields to Turkish markets and eventually to Europe, part of a wider Southern Gas Corridor project that aims to diversify gas supplies and reduce European countries' dependence on Russia.

With reporting by RFE/RL's Balkan Service and AP