After the Philippine Rebellion against annexation failed, the Philippines became a U.S. territory and remained so until after World War II. The U.S. established colonial rule in the Philippines and implemented policies aimed at modernizing and "civilizing" the country. These policies included building infrastructure, improving healthcare, and establishing a formal education system. Despite some resistance from nationalist groups, the Philippines remained a U.S. territory until it gained independence in 1946.