That means the Aussies will take on third place from Group B, likely to be Serbia or Mali, in the crossover game tomorrow with the tournament now entering a knockout phase.
Heading into their final clash of the group stage, the Crocs were coming off a heartbreaking loss to Turkey while Puerto Rico were the only undefeated team left in the pool.
Australia started well, opening up a four-point edge at quarter-time but they were not going to be let off with a comfortable game as Puerto Rico came back to take a three-point lead going into the final term.
The Crocs scored six straight early in the fourth, courtesy of a Joel Capetola three and relentless work in the paint from Luke Jackson.
The lead then went back and forth as the game headed towards another thrilling conclusion with Tamuri Wigness' pressure on the ball-carrier and steals from Capetola (eight points, three steals) and Luke Travers ensuring Puerto Rico had no easy baskets.
Inside the last minute with the scores tied, Travers was sent to the free-throw line but he missed both shots.
Puerto Rico were unable to make him pay at the other end though and Wani Swaka Lo Buluk (eight points, five rebounds) secured the defensive rebound to give the Aussies a chance for the final shot of the game.
Out of a time-out, coach Justin Schueller drew up a play to get Travers (15 points on 7-10 shooting, three steals) to the basket and while his shot left time on the clock, it put Australia up by two with only six seconds remaining.
They then had to hold off their opponents on one last possession and Tory San Antonio had an attempt from inside the free-throw line but the shot rimmed out with Jackson (a huge 14-points, 15-board game) securing the rebound to give Australia a brilliant win.
Find the box score here and the highlights against Puerto Rico below.
The Crocs' defence is getting the job done at the moment and they held Puerto Rico to 34% shooting while only hitting 4-16 from the three-point line themselves.
Turnovers continue to plague them, racking up 29 overall, but 12 steals helped negate that with Wigness countering six errors with nine points, six boards, three assists and four steals.
Stay tuned for information on Australia's next opponent in the Round of 16 once the group stage games are complete.
You can watch every game of the Crocs' Under-17 World Cup campaign via Basketball Australia's Facebook page (technical difficulties from FIBA interrupted the feed last night) or on FIBA's YouTube channel here.
The Australian Crocs Schedule for the 2018 FIBA Under-17 World Cup (all times AEST):
July 5: Round of 16
July 7: Quarter-Finals
July 8: Semi-Finals
July 9: Medal Games