As the centuries passed, Ostia fell into ruin but continued to provide maritime access for visitors to Rome. Saracen pirates were a frequent concern; the naval Battle of Ostia was fought off the coast in 849. Pope Gregory IV fortified the existing borough and it was rechristened Gregoriopoli. By this time, the shifting course of the Tiber had landlocked the ancient port, and the town was mainly a shelter for the workers of the nearby salt mills.