During the 16th century, productive farm land was extended and enhanced by drilling wells to obtain water and convert dry land into irrigated fields, making it possible to begin commercial agriculture in the 17th century. After the city's disastrous participation in the War of the Spanish Succession, in the second half of the 18th century, the first industries were established, mainly for textiles. Also during that time, the city became involved in various revolts and wars which changed Spain's political make-up.