The Treaty of Madrid was a peace treaty between the Republic of Venice and the Habsburg monarchy, ending the Uskok War. Its indirect consequence was the elimination of Uskok piracy in the Adriatic Sea.