On October 18, 1898, with the Spanish–American War nearly over, the United States raised its flag over Puerto Rico, officially taking possession of the former Spanish colony, formalizing US authority over the one million inhabitants in the territory.