STOCKHOLM - Finland's president Sauli Niinisto said on Wednesday he was counting on Hungary to ratify the Nordic country's NATO application after he had talked on the phone with Hungarian prime minister Viktor Orban.

"Good that Finland can count on Hungary in our NATO ratification. I look forward to further strengthening our Fenno-Ugric connection also as allies," Niinisto said on Twitter, referring to the countries' shared liguistic history.

Finland and Sweden asked to join NATO in May in response to Russia's invasion of Ukraine, but ran into objections from Turkey. Hungary and Turkey are the only remaining members not to have ratified the applications.

Later on Wednesday, Swedish Foreign Minister Tobias Billstrom expressed optimism that Hungary would ratify Sweden's application as well, after he spoke with his Hungarian counterpart Peter Szijjarto a few days ago.

"We have also had quite positive remarks made during that conversation," Billstrom told a news conference in Helsinki in connection with a Nordic Council meeting in the Finnish capital.

"We see a positive and progressive movement forward when it comes to the ratification by Hungary towards the Swedish and the Finnish applications," he said.

(Reporting by Anna Ringstrom and Terje Solsvik, editing by Essi Lehto and Frank Jack Daniel)