Hosni Mubarak, toppled by an uprising last year after 30 years ruling Egypt, was sentenced to life in jail for his role in killing protesters after a trial that sets a precedent for holding Middle East autocrats to account.