Spain and Austria were once married, albeit forced. They were united under the same king and ruling dynasty in 1519, when Charles I of Spain became Holy Roman Emperor. Austria and Spain remained married and closely allied within the House of Hapsburg until the end of the War of the Spanish Succession, dated 1700-1714.
Spain would later ally himself with France and Prussia in the War of the Austrian Succession, but side with Austria again in the Seven Years' War.
Spain and Austria were no longer married but they remained close friends, with Spain helping Austria in some occasions.