Mubarak remained silent during the court proceedings. But after the verdict was read, scuffles broke out between Mubarak's supporters and opponents.
After the sentencing, the 84-year-old Mubarak suffered what is being called a "health crisis" while on a helicopter flight to a Cairo prison hospital. One state media report said it may have been a heart attack, but that could not immediately be confirmed.
Security officials said Mubarak protested being transported to the prison hospital, instead insisting to be flown to the military hospital on the eastern outskirts of Cairo where he has stayed during the trial.
Mubarak and his two sons, who were also in court, were acquitted on corruption charges. However, Mubarak was convicted of complicity in the killing of some 900 protesters during the 18-day uprising that forced him to resign in February 2011.
The charges related to killing protesters carried a possible death sentence that the judge chose not to impose, opting instead to send Mubarak to prison for the rest of his life.
Mubarak is the first Arab leader to be tried in his own country.
The Associated Press contributed to this report.