The Republic gradually declined due to a combination of a Mediterranean shipping crisis and the catastrophic earthquake of 1667 that killed over 5,000 citizens, levelled most of the public buildings and, consequently, negatively affected the well-being of the Republic. In 1699, the Republic was forced to sell two mainland patches of its territory to the Ottomans in order to avoid being caught in the clash with advancing Venetian forces. Today this strip of land belongs to Bosnia and Herzegovina and is that country's only direct access to the Adriatic. A highlight of Dubrovnik's diplomacy was the involvement in the American Revolution.