BEIJING -- Andrew Bogut likely will be investigated for a foul-mouthed post-game spray after Spain beat Australia 95-88 in a double-overtime World Cup semifinal heartbreaker Friday.

Spain trailed by 11 against the Boomers but, just like in the Rio Olympic bronze medal game three years ago, rallied and went ahead courtesy of a controversial foul -- this time on Bogut -- in the final seconds.

Patty Mills (34 points) had the chance to get one back for Australia after their one-point loss in Rio, at the line with four seconds on the clock and down by one.

An upset Andrew Bogut makes the money signal with his hands. Garrett Ellwood/NBAE via Getty Images

But his second free-throw bobbled out, and Ricky Rubio's long heave just missed for Spain to force overtime.

Matthew Dellavedova's desperate floater at the buzzer clanged out to send the teams into a second extra period, where Marc Gasol (33 points) and Rubio (19 points, seven rebounds, 12 assists) steered their side clear.

A "furious" Boomers team surged through the media zone post-game, Bogut yelling "Google where headquarters of f---ing FIBA is ... it's a f---ing disgrace" and also using referencing "cheating" as he headed toward the dressing room.

On court he had earlier flashed a money signal with his hands after the foul that helped put Spain ahead.

Pau Ribas of Spain handles the ball during FIBA World Cup 2019 semi-final match against Australia. VCG/VCG via Getty Images

Bogut likely will face an investigation and possible fine ahead of Sunday's bronze-medal game against France, which was upset 80-66 by Argentina in the other semifinal.

His comments were curious though, given FIBA headquarters are in Switzerland, while the Boomers also had a handful of questionable calls fall their way and made 22 turnovers to allow Spain an escape route.

Sunday will be Luc Longley's fourth bronze-medal game, having played in two and coached in one already, the most recent in eerily similar circumstances against the same opponent in Rio. That frustration showed post-game for the Boomers assistant coach, who offered his own profane analogy.

"We've got to find an altar somewhere and burn a sacrifice to the basketball gods, 'cause they're not kissing us on the d--- yet, like they do Spain," he said.

"It's gut-wrenching for the guys; they've been so f---ing good, so consistent and played so hard and I felt like they deserved to win that and it doesn't feel like that's the right result."

Australia's Patty Mills dribbles past Spain's Sergio Llull. NOEL CELIS/AFP/Getty Images)

Australia did have their moments though, with Mills' free-throw somehow rimming out and turnovers the constant olive branch to a Spain side that shot at just 31 percent in the second half.

Dellavedova's attempted game-winner looked good too, before it bounced out and he was forced out of the second overtime period with cramps.

Nick Kay was enormous for Australia off the bench, scoring 16 points and grabbing 11 boards as the Boomers collected a staggering 20 offensive rebounds.

"They're furious, crushed. ... It's very quiet in there and it stings in lots of ways, not least of which is that's the team we lost to in Rio," Longley said.

"It's not the time to start pointing fingers and spitting dummies; we've got to reload."