During its rule, Spain quelled various indigenous revolts, as well as defending against external military challenges. Spanish forces included soldiers from elsewhere in New Spain, many of whom deserted and intermingled with the wider population. Immigration blurred the racial caste system Spain maintained in towns and cities. War against the Dutch from the West, in the 17th century, together with conflict with the Muslims in the South nearly bankrupted the colonial treasury.