But as the invaders advanced north towards Rome , Naples successfully linked up with the then powerful maritime republic of neighboring Amalfi .
The cities of Naples and Amalfi have a longstanding relationship .