He has been in detention since returning to Russia last month. He had been treated in Germany for a near-fatal nerve agent attack against him in August.
Thousands of supporters have rallied across Russia in support of Mr Navalny.
His suspended sentence for embezzlement has been converted into a jail term.
He has already served a year under house arrest which will be deducted from the total.
In court he called President Vladimir Putin a “poisoner”, blaming him for the attack.
His supporters called for an immediate protest and tried to gather outside court but the whole area was overrun with riot police. More than 300 have been detained, according to monitors.
His lawyer said they would appeal against the ruling.
Strong international reaction to the sentence came quickly, with the Council of Europe – the continent’s leading human rights body – saying the judgement “defied all credibility”.
UK Foreign Secretary Dominic Raab described the ruling as “perverse”, and US Secretary of State Antony Blinken said he was deeply concerned by it.
Mr Navalny has been accused of breaking the terms of a 2014 suspended sentence for embezzlement that required him to report regularly to Russian police. His lawyers say the accusation is absurd as the authorities knew he was recovering in Berlin from the nerve agent attack that nearly killed him in Russia.
Addressing the court before the sentencing, Mr Navalny said the case was being used to frighten the opposition: “This is how it works: they send one to jail to intimidate millions.”
On the Novichok chemical attack, he said: “Using the FSB [Federal Security Service of Russia], Putin attempted to commit murder. I’m not the only one – many know this already and many others will. And this is driving the thieving little man in the bunker crazy.
“No matter how much he tries to look like a geopolitician, he took offence at me because he will go down in history as a poisoner.”
Mr Navalny’s return to Russia on 17 January triggered mass protests in support of him, many of them young Russians who have only ever experienced President Putin’s rule.
The Kremlin has denied any involvement in the attack on him, and rejects the conclusion by Western experts that Novichok – a Russian chemical weapon – was used.
‘Putin’s palace’
Mr Navalny accuses Mr Putin of running an administration riddled with corruption, and recently released a YouTube video featuring an opulent Black Sea palace which, he alleged, was a Russian billionaires’ gift to the president.
Some protesters on Sunday brandished gold-coloured toilet brushes, a symbol of their anger about the palace.
On Saturday Arkady Rotenberg, a billionaire businessman close to Mr Putin, said he owned the palace and had bought it two years ago.
The OVD-Info group said police detained more than 5,000 people at pro-Navalny protests in 86 cities across the country on Sunday. For a second weekend, crowds defied bitter cold and a massive deployment of riot police.
OVD-Info says it is an independent Russian media project, which gets crowdfunding in Russia and its donors include the Memorial human rights group and the European Commission.
Mr Navalny is already serving a 30-day sentence in connection with the embezzlement case, which he denounces as politically motivated.
In recent days police have arrested many of Mr Navalny’s top aides, who assist him in his Anti-Corruption Network (FBK).