Crowds in Tahrir Square cheered and launched fireworks after the military announced Mohamed Morsi has been ousted as president and replaced by the chief justice of the constitutional court.