MOSCOW -- The hoodie stayed back at the hotel when Mark Zuckerberg, the founder of Facebook, met Russia's prime minister and former president, Dmitri A. Medvedev, on Monday.
"Good conversation with Prime Minister Medvedev," Mr. Zuckerberg wrote on his Facebook wall beside a picture of the two, in suits and grinning, at the Russian leader's residence outside Moscow.
Mr. Zuckerberg also visited Red Square -- in his hoodie -- ate at McDonald's and helped judge a competition for Russian programmers under way in Moscow in his first visit to Russia, a country that is in important ways pivotal for Facebook.
One of Google's founders, Sergey Brin, is Russian by birth. For Facebook, the tie is more oblique: The country is an important test case for the balancing act Facebook is undertaking as a new media company in countries that are important commercially but have traditionally heavily regulated their old media, if not censored it. And two of Facebook's largest investors are Russian.
Mr. Zuckerberg and Mr. Medvedev talked about Facebook's role in politics, though only jokingly in reference to its importance in the American presidential campaign, according to Mr. Medvedev's press office.
They also discussed copyright rules and high-tech business. Mr. Zuckerberg gave the Russian leader a T-shirt; the meeting lasted about 20 minutes.
Facebook, in Russia as elsewhere, plays a double role as a tool for posting silly party pictures and a tool for political organizing.
Facebook played an integral role in political dissent in Russia last winter, allowing street protests to coalesce when handing out fliers or posting notices on corkboards would not have worked.
Russia is also home to two large and early Facebook investors, Alisher Usmanov, a steel tycoon, and Yuri Milner, an expert on monetizing social network traffic in emerging markets. The two partly cashed out in the initial public offering of Facebook stock earlier this year but still own billions of dollars' worth of shares.
More Russians are online today than Germans, making Russia the largest Internet market in Europe. Russians also, strangely, have spent more freely relative to their income than Americans on virtual products, like special powers for online games, making their country a useful market for testing revenue streams other than advertising.
Earlier this month, in another step deeper into the Russian market, Facebook made a deal with one of Russia's mobile phone operators, Beeline, to provide a free application to subscribers.
The Russian government, led by Mr. Medvedev, a technology lover, has embraced the Internet for its commercial potential even as it has been subtly trying to rein in the politics.
Such features as most-viewed lists of blogs, for example, are frowned on at Russian-run sites beholden to the Kremlin, lest a critical text go viral based on user approval.
In its prospectus for the initial public offering, Facebook had cautioned of the business risk of being banned from foreign markets, as it has been in China by the "Great Firewall."
For now, Russia's Internet is mostly unfettered.
In that spirit, pictures of the Facebook founder's dog, Beast, which he posts on his Facebook page, became the topic of conversation in an episode Mr. Zuckerberg filmed for a Russian late-night comedy show on Monday.
Correction: October 2, 2012, Tuesday
This article has been revised to reflect the following correction: An earlier version of this article misstated the surname of Mark Zuckerberg as Zuckerman at one point.
This article originally appeared in The New York Times.