On May 1, 1898, the Battle of Manila Bay took place as part of the Spanish–American War. On May 24, Aguinaldo, who had returned from voluntary exile on May 19, announced in Cavite, "... I return to assume command of all the forces for the attainment of our lofty aspirations, establishing a dictatorial government which will set forth decrees under my sole responsibility, ..." On 12 June, Aguinaldo proclaimed Philippine independence. On 18 June, Aguinaldo issued a decree proclaiming a Dictatorial Government led by himself. On June 23, Aguinaldo issued another decree, which replaced the Dictatorial Government with a Revolutionary Government. In 1898, between June and September 10, the Malolos Congress elections were held by the Revolutionary Government, resulting in Emilio Aguinaldo being elected as President of the Philippines. On February 2, 1899, hostilities broke out between U.S. and Filipino forces. The Malolos Constitution was adopted in a session convened on 15 September 1898. It was promulgated on 21 January 1899. creating the First Philippine Republic with Aguinaldo as President. On June 12, 1899, Aguinaldo promulgated a declaration of war against the U.S., beginning the Philippine–American War. U.S. forces captured Aguinaldo on March 23, 1901, and he swore allegiance to the U.S. on April 1. On July 4, 1902, U.S. President Theodore Roosevelt proclaimed a complete pardon and amnesty for all Filipinos who had participated in the conflict, effectively ending the war.