In the 6th century, from 501 to 600, Rome saw a power-struggle between Germanic tribes and the Byzantine Empire. The city was controlled by Ostrogoths until 536, when the Byzantine general Belisarius recaptured it. In 546, the Ostrogoths under Totila recaptured anc sacked Rome. Belisarius retook the city, but in 549 the Ostrogoths captured it again. In 552, Belisarius captured Rome for the third time, this time for good. This meant an end to the Gothic Wars. Although a more peaceful period began, Rome was in bad shape. The aqueducts were in disrepair, and while some were patched up to provide water, they were not restored to their former state. Many districts were abandoned, and the population continued to drop. The city came under Ravenna's control, but power soon devolved to the Pope who became the de facto ruler of the city.