ST. PETERSBURG, Russia — When Russian President Vladimir Putin invited NBC’s Megyn Kelly to question him onstage at a glitzy forum here, maybe he thought he’d have an easier time than Donald Trump did in his confrontation with Kelly during the 2016 campaign. It didn’t work out that way.

Putin’s appearance at the St. Petersburg International Economic Forum was meant to showcase Russia’s role in the global economy. And in Putin’s prepared remarks, he was a smooth, genial salesman for his country. But then came a session with Kelly that included sharp questions about the hacking scandal, Syria and Ukraine — and Putin grew increasingly aggressive, sarcastic and peeved.

Russians probably liked Putin’s combative performance: That’s part of his brand, and he’s indisputably popular at home. But the day’s events also showed how allegations of Russian meddling abroad, though they’re seen here as evidence of Russia’s revived power, also cloud Putin’s efforts to lure more foreign investment and expand Russia’s global role.

Putin’s abrasive style comes at a cost. Economic sanctions, for example, are probably less likely to be lifted now than was the case at last year’s St. Petersburg forum. American chief executives who have business interests in Russia “are keeping their heads down,” noted a leading U.S. businessman here. “It’s hard to attract new investment in Russia when the political situation [affecting Russia] is so uncertain.”

Russian President Vladimir Putin denies any collusion took place between Russia and President Trump’s campaign before Trump’s inauguration. Putin spoke at a forum in St. Petersburg moderated by Megyn Kelly. (Reuters)

Kelly questioned Putin bluntly and repeatedly about hacking and other controversial topics. This drew various pained responses, including an exasperated jab at “hysterical” critics: “Maybe someone has a pill that will stop this.” At another point, he said that the U.S. media should “stop this idle prattle” about Russia, which was harming diplomacy.

The forum is designed as a lavish rebranding exercise for the new Russia. It’s run on the Davos model, with discussions and debates, and many hundreds of bankers and business executives networking together. The official theme this year was achieving a “new balance,” with Russia’s global economic clout rising even as America’s is seen to be receding. Many of the tech projects on show here were compelling.The discussion topics conveyed the aspirational nature of the gathering: “The Reinvention of Global Banking,” “Russia’s Winning Strategy in the Eastern and Western Digital Race” and perhaps most unlikely, after recent doping scandals, “Sport — A Space for Trust.”

Russians I talked with here and in Moscow were frank that Russia still has a very long distance to travel.

“Institutions are not well developed,” said Andranik Migranyan, a politics professor and former government official. “It’s a highly personalized system,” which Putin feels he must steer “manually.” And Russia is still too dependent on energy exports, even though Putin said in his speech Friday that the export share of other industries is rising.

Corruption also remains a big problem, despite talk here of more independent and dependable legal institutions. Sergey Karaganov, the director of Russia’s Council on Foreign and Defense Policy, addressed this issue head-on in a conversation earlier this week in Moscow: “I would agree that institutions are weak” and that contracts often go to “those who play the game.” The problem, he said, was that in 1991, “we introduced capitalism without the rule of law.”

Still, Karaganov said, the system has an unlikely benefit for Putin’s administration: “This corruption allows the possibility to rule without using brutal force. If you know that many of your people at the local level are corrupt, you can make them obedient. But that does not provide for development.”

That’s Putin’s problem, in essence. His tough-guy, strongman style has certainly helped him to govern Russia. But it may also obstruct his desire to move the country to a more advanced and prosperous state at home and in global markets.

Through nearly three hours onstage, Putin refrained from any real criticism of Trump. He echoed Trump’s line that the hacking scandal is pushed by Hillary Clinton’s backers as an excuse for their failure.

As for Trump’s announcement this week that the United States will withdraw from the Paris accord on climate change (which Russia still supports), Putin said: “I wouldn’t judge President Trump.” One more thing: After today, the two leaders probably share a wariness of being questioned by Kelly.

Russian President Vladimir Putin compared allegations of Russian hacking in the 2016 presidential election to anti-semitism. Putin spoke at a forum in St. Petersburg moderated by Megyn Kelly. (Reuters)