The 82-year-old submits his resignation in the wake of weeks of protests, state media report.