Louis' successor King Charles VIII of France however ceded both territories to Maximilian, now Holy Roman Emperor by the 1493 Treaty of Senlis. Then a state of the Holy Roman Empire, Artois as one of the Seventeen Provinces of the Habsburg Netherlands from 1512 on belonged to the Burgundian Circle and from 1556 was held by Habsburg Spain. In 1579 Artois together with Hainaut and Walloon Flanders signed the Union of Arras loyal to the Spanish Habsburgs, while in reaction the seven northern provinces of the Spanish Netherlands formed the Union of Utrecht, the precursor of the Dutch Republic. Artois in the course of the Franco-Spanish War was conquered by the troops of King Louis XIII of France in 1640 and reverted to French rule by the 1659 Treaty of the Pyrenees.