In the first verdict in a series of trials he is facing, the Cairo court convicted Morsi of ordering the arrest and torture of protesters involved in clashes in 2012 when he was president.
Fourteen others were convicted on the same charges, with most also sentenced to 20 years in jail.
But the court acquitted the defendants on charges of inciting murder over the deaths of a journalist and two protesters during the December 5, 2012 clashes outside the presidential palace in Cairo.
Defence lawyers said they would appeal the convictions.
Egypt’s first freely elected leader, Morsi came to power following the 2011 ouster of longtime autocrat Hosni Mubarak in a popular uprising.
But after just a year in power, Morsi was himself toppled by then-army chief and now President Abdel Fattah al-Sisi following mass street protests.
Morsi’s Muslim Brotherhood has been blacklisted and targeted in a government crackdown that has seen hundreds killed and thousands thrown in jail.
Other Brotherhood leaders have been sentenced to death and Tuesday’s decision to acquit Morsi on the incitement to murder charge was unexpected.
“This is a surprise… We were expecting them to be convicted of murder,” Ramy Ghanem, a lawyer for an anti-Morsi protester who was wounded in the clashes, told AFP.
“But the sentences are not bad. We were expecting life in prison, but then 20 years is not very different,” he said. A life sentence in Egypt is 25 years.
Hundreds of Morsi supporters have been sentenced to death in speedy mass trials which the United Nations has called “unprecedented in recent history”.
A Cairo court earlier this month confirmed death sentences for Muslim Brotherhood leader Mohamed Badie and 13 others over protest violence.
The Brotherhood had called for protests in support of Morsi on Tuesday.
“The coup commander is exploiting the judiciary,” it said in a statement ahead of the verdict, referring to Sisi.
It said the president was using the courts “as a weapon in the battle against the popular will and the democratic and revolutionary legitimacy represented by President Mohamed Morsi.”
– More verdicts due in May –
Morsi is facing two other trials in which he could face the death penalty, including one that sees him accused of spying for foreign powers.
Verdicts in those two cases are due on May 16.
Sisi has vowed to “eradicate” the Brotherhood, an 85-year-old movement that topped successive polls between Mubarak’s fall and Morsi’s presidential election victory in May 2012.
The authorities designated it a “terrorist group” in December 2013, making even verbal expressions of support punishable by stiff jail terms.
The crackdown has sparked a fierce backlash including from jihadist groups, who have claimed a string of deadly attacks on security forces.
Officials say more than 500 police and soldiers have been killed in attacks since Morsi’s overthrow.
Sisi was elected president in May last year, but he faced no serious challengers and — in a country where the army has been in power for decades — his victory dashed hopes raised by Mubarak’s ouster of a civilian democracy.
Sisi’s regime is popular among many Egyptians tired of political turmoil and seeking stability and economic growth.
But Sisi has been accused of repression and his crackdown has also targeted secular and liberal activists who spearheaded the 2011 uprising against Mubarak.
In November, a court dropped murder charges against Mubarak in his own trial over the deaths of hundreds of protesters in 2011. -AFP