In October 1945, Shichirō Kihara was appointed the next Mayor of Hiroshima, and in December Hamai became his deputy. Following Kihara's dismissal from his duties in March 1947 by the Allied occupation authorities and the reforms conducted in Japan by General McArthur, first mayoral elections were held in Hiroshima in April 1947. In that election, Hamai ran against five other candidates, which included vice mayor Hisao Yamamoto and city council chairman Tsukasa Nitoguri. He won the election and became the first popularly elected mayor of Hiroshima.