Spanish was the official language of the country for more than three centuries under Spanish colonial rule, and became the lingua franca of the Philippines in the 19th and early 20th centuries. In 1863, a Spanish decree introduced universal education, creating free public schooling in Spanish. It was also the language of the Philippine Revolution, and the 1899 Malolos Constitution effectively proclaimed it as the official language of the First Philippine Republic. National hero José Rizal wrote most of his works in Spanish. Following the American occupation of the Philippines and the imposition of English, the use of Spanish declined gradually, especially after the 1940s.