As the 19th century gave way to the 20th, there followed in quick succession the Philippine Revolution, which spawned the short-lived First Philippine Republic, and the Philippine–American War.[18] Aside from the period of Japanese occupation, the United States retained sovereignty over the islands until 1945. After World War II, the Philippines was recognized as an independent nation. Since then, the Philippines has often had a tumultuous experience with democracy, which includes the overthrow of a dictatorship by a nonviolent revolution.