Puerto Rico was ceded by Spain in the aftermath of the Spanish–American War under the terms of the Treaty of Paris of 1898 and became a territory of the United States. In 1899, the United States Department of War conducted a census of Puerto Rico finding that the population of Caguas was 19,857.