At least as of the 12th century, the Catalans built the "Catalan galleys", making extensive use of them for wars with the different maritime republics (as enemies or as allies) or for trade with most Mediterranean ports, guaranteeing trade routes with Catalan consulates. Its use began to decline from the seventeenth century, when they were progressively replaced by sailboats, finally becoming extinct in the late eighteenth century .