Mexico edged the United States 3-2 after 10 innings on Sunday to take third place at the WBSC Premier 12 baseball tournament and qualify for the Tokyo 2020 Olympics.
Matthew Clark's solo homer for Mexico at the bottom of the ninth tied the bronze medal match 2-2, sending it to extra innings.
Efren Navarro's single to centrefield at the bottom of the 10th drove home the winning run to seal the central American country's Olympic berth.
Hosts Japan, with a 4-1 win-loss record in six-nation Super Round, and South Korea (3-2) will face off in the final later of the World Baseball Softball Confederation (WBSC) Premier 12 tournament.
One Olympic place for the Americas and one for Asia were up for grabs, meaning South Korea have also secured their berth by virtue of Japan already being qualified as hosts.
Taiwan finished fifth in the standings with Australia sixth.