Getty Images

Mexico have won the Olympic men's soccer bronze medal after a 3-1 win over hosts Japan in Saitama.

El Tri add third place in Tokyo to their 2012 gold thanks to Sebastian Cordova, Johan Vasquez and Ernesto Vega goals.

Samurai Blue were hopeful of their first-ever Olympic medal finish, but fell short with only Kaoru Mitoma's late effort for consolation.

Jaime Lozano's squad sign off on a high after their penalty defeat to finalists Brazil in the semifinals while Hajime Moriyasu's side just could not muster enough in attack after their narrow loss to Spain in the final four.

For the hosts, it was a case of what might have been while Mexico's largely domestic-based group now have a chance to use this success to build on moving forward.

Brazil and Spain meet in Yokohama to contest the gold medal match on Saturday and bring an end to soccer at the Olympics.