Sun Yat-sen spent time living in Japan while in exile. He was supported by the Japanese politician Tōten Miyazaki. Most Japanese who actively worked with Sun were motivated by a pan-Asian opposition to Western imperialism. While in Japan, Sun also met and befriended Mariano Ponce, then a diplomat of the First Philippine Republic. During the Philippine Revolution and the Filipino-American War, Sun helped Ponce procure weapons salvaged from the Japanese military and ship the weapons to the Philippines. By helping the Philippine Republic, Sun hoped that the Filipinos would win their independence so that he could use the archipelago as a staging point of another revolution. However, as the war ended in July 1902, the United States emerged victorious from a bitter 3-year war against the Republic. Therefore, the Filipino dream of independence vanished with Sun's hopes of allying with the Philippines in his revolution in China.