Kashima (Japan) (AFP) – Megan Rapinoe scored twice, including direct from a corner, as the United States claimed a consolation bronze in the Olympic women’s football tournament Thursday with a 4-3 victory over Australia.

Rapinoe, who refused to speculate on her international future after the semi-final loss to Canada, struck either side of a Sam Kerr goal in Kashima that saw her become Australia’s all-time leading scorer.

Carli Lloyd drilled in a third for the Americans just before half-time on her 312th international appearance — second only behind Kristine Lilly, whose 354 caps are the most in the history of the sport.

The 39-year-old Lloyd added a fourth early in the second half after more suspect Australian defending, with a rousing comeback from the Matildas coming up just short despite goals from Caitlin Foord and Emily Gielnik.

Coach Vlatko Andonovski recalled both Rapinoe and Lloyd to the line-up following the USA’s first defeat to Canada in 20 years that ruined their hopes of a fifth Olympic title in seven editions.

This was a much more absorbing contest than the 0-0 draw between the teams in the group stage, with Rapinoe putting the USA ahead on eight minutes when she whipped in a corner that flashed beyond Australia goalkeeper Teagan Micah.

Kerr edged ahead of Lisa De Vanna with her 48th international goal, squeezing the ball past Adrianna Franch — in for the injured Alyssa Naeher — to bring Australia level on the quarter-hour.

Franch then flew to her right to palm away a Kerr header, but Rapinoe soon punished a miscued clearance by Alanna Kennedy, rifling home a superb volley to put the Americans back in front.

Australia were again made to pay for losing the ball deep inside their own half as Lindsey Horan slipped in Lloyd, the two-time Olympic gold medallist and World Cup winner smacking her shot inside the far post.

More ponderous defending by Australia, without the suspended Ellie Carpenter following her red card against Sweden, allowed Lloyd to get in behind the backline and make it 4-1 early in the second half.

But to their credit Australia continued to threaten and were rewarded when an unmarked Foord headed beyond Franch with more than 30 minutes still to play.

Kerr watched her header agonisingly spin away from goal after rebounding off the post, while Gielnik’s searing drive from distance in the final minute came in vain.