It came down to the final seconds, but Australia came up short against Spain in the bronze medal basketball game.

Getty Images: Christian Petersen

The Boomers have missed out on the podium in Rio after an agonising 89-88 loss to Spain in a breathtaking bronze medal game.

Australia was leading 88-87 with just under 10 seconds on the clock, but two free throws landed by Spain and a spilt possession in the dying stages saw the bronze slip from its grasp.

The Boomers have now finished fourth at the Games on four occasions but perhaps this was their best chance to walk away with a medal.

Inside the final three minutes the Boomers were 80-79 ahead before a thrilling passage of play saw the lead swap eight times prior to a Patty Mills foul sending Sergio Rodriguez to the line.

Rodriguez barely broke a sweat in coolly slotting both attempts but even with just over five seconds on the clock the Boomers still had a chance to snatch the win as they were given possession back up court.