His sentencing followed a day of nationwide anti-corruption demonstrations, during which nearly 1,400 people were arrested amid scuffles with police and reports of tear gas being used.
Navalny, in court in Moscow, accused the judge of helping the police write the justification for his arrest and showed defiance by praising the protesters as "brave, wonderful people."
"I am very pleased that people came out, I am proud that I am a part of this movement in which brave, wonderful people, are not afraid to go out on the streets. Even under the threat of some detentions and so on," he said.
After his sentencing, Navalny tweeted, "30 days. Not only they robbed the whole country, but I'll miss Depeche Mode concert in Moscow because of them."
His wife, Yulia, reported Navalny, 41, was detained at his Moscow home, before he could join the thousands of protesters who clashed with police in Moscow and St. Petersburg.
The opposition leader, who plans to run against Vladimir Putin in next year's presidential election, had mobilized support on social networks in the hope the rallies would rattle the Kremlin.
Hundreds of arrests
Nearly 1,400 people were arrested in the two cities on Monday, according to OVD, an independent group monitoring arrests. Of those, 825 people were detained during protests in the capital and 548 were arrested in St. Petersburg, the group said.
Earlier in the day, the Russian Ministry of Internal Affairs posted different numbers for the two cities: 150 in Moscow and 500 in St. Petersburg.
Russian authorities had declared the planned rally in the capital was illegal, and warned those intending to take part that there would be consequences.
"Law enforcement agencies will be forced to take all necessary measures to stop provocations, mass unrest or any actions leading to a violation of public security, creating conditions for threatening the life and health of citizens," the prosecutor general said in a statement.
White House Press Secretary Sean Spicer condemned the arrests and called on Russia "to release all peaceful protesters."
"The United States strongly condemns the detention of hundreds of peaceful protesters throughout Russia," Spicer said, calling it "an affront to core democratic values."
Clashes with police
Photographs and videos posted on Twitter showed large numbers of police at Tverskaya Street, a main thoroughfare near the Kremlin. The protesters shouted "Putin is a thief," "Putin out" and "Russia without thieves." Pictures on social media showed police putting gas masks on.
Navalny's press secretary, Kira Yarmysh, posted on Twitter that tear gas was used against her.
Teenager Anna Meigan said she was detained as she protested in Moscow.
"My sister and I went to an anti-corruption rally. We left the Pushkinskaya metro station and after five minutes the riot police ran up to us and dragged us to the police bus, which after a few minutes was already crowded with people," the 18-year-old told CNN via text message.
There was also a large police presence in St. Petersburg, where protesters chanted "shame" during a rally at the Field of Mars park.
More than 200 towns and cities signed up for protest rallies to mark the Russia Day public holiday, according to Navalny's social media accounts. The opposition leader said earlier they would proceed regardless of whether the government allowed them.
In March, thousands joined protests in almost 100 cities across Russia, angered by a report that Navalny published accusing Prime Minister Dmitry Medvedev of corruption. Medvedev has denied the claims.
Navalny was arrested, along with hundreds of others, and jailed for 15 days after being convicted of disobeying a police officer.
His election campaign comes despite him being convicted of embezzlement and given a suspended sentence in February. Russian laws prohibit convicted people from running for office. Navalny says the charges against him are politically motivated.