U.S.-backed militias said they had defeated the Islamic State in its former capital Raqqa on Tuesday, raising their flags over the jihadi group's last footholds in the city after a four-month battle.