Paolo Guerrero teed up Peru's first World Cup goal in 36 years and then scored the second himself as Ricardo Gareca's side ended Australia's qualification hopes with a 2-0 victory.
Experienced striker Guerrero, who was only allowed to play in the tournament after the captains of Peru's World Cup opponents petitioned FIFA to temporarily lift his suspension, made the most of what may have been his final appearance for Los Incas, who finished with three points to add to the many plaudits they have won in Russia.
Their opener would have been worthy of winning any World Cup match, Andre Carrillo volleying Guerrero's weighted cross into the net to beckon forth a cavalcade of emotion from the hordes of Peru fans packing the stands in Sochi.
The talismanic Guerrero, 34, made his mark on the game's biggest stage with his 36th international goal early in the second half, extending his record as the country's all-time leading scorer.
Despite head coach Bert van Marwijk throwing on talented 19-year-old Daniel Arzani and veteran Tim Cahill to try and turn the game, Australia failed to muster a comeback as they finished bottom of Group C.
40 - Peru have won their first World Cup game for 40 years and 15 days, since beating Iran 4-1 in 1978; the fourth longest gap between victories in the competition. Sash. #PER #AUSPER #WorldCup pic.twitter.com/qP7VNvdYw2— OptaJoe (@OptaJoe) June 26, 2018
A win would not have been enough for the Socceroos anyway, as Denmark picked up the point they needed to accompany France through to the last 16.
Mile Jedinak was booked for a high boot on Christian Cueva after nine minutes of the first half and Australia looked the better side as they sought to stamp their authority on the game.
But they were rocked by a brilliantly taken Peru goal after 18 minutes when Guerrero broke into the penalty area, cut back onto his right foot and swung a deep cross for Carrillo to lash a volley through Jedinak's legs and into the bottom right corner of Mat Ryan’s net.
They had to wait 36 years, but Peru finally get their goal! 🇵🇪🙌— FOX Soccer (@FOXSoccer) June 26, 2018
Carrillo hits it one time from distance to put them up 1-0 on Australia. pic.twitter.com/bkHoCiob7s
Peru then had to soak up some pressure as Tom Rogic beat three defenders on a jinking run into the penalty area after 26 minutes and saw his shot saved by Pedro Gallese, before Mathew Leckie was denied by a last-ditch Anderson Santamaria tackle as he slid in on goal.
The second half was five minutes old when Guerrero struck, hooking the ball into the far corner of the net beyond Ryan's left hand to leave Australia with a sizeable task ahead of them.
PAOLO GUERRERO!— FOX Soccer (@FOXSoccer) June 26, 2018
The captain doubles Peru's lead as La Blanquirroja look for their first win of the 2018 FIFA World Cup. pic.twitter.com/t5b1RViJIe
They set about it immediately as Jedinak's far-post header was denied by Gallese and Trent Sainsbury fired wide from close range, while substitute Cahill had a volleyed effort blocked in the penalty area.
As the minutes ticked away so too did Australia's hopes of a turnaround; Aziz Behich got in behind the Peru defence and had time and space to pick his spot but instead opted to send a cross beyond the unmarked Cahill.
Edison Flores almost added a third goal on the counter when he crashed a low drive onto the post from the edge of the box in the closing minutes, but the offside flag was raised and there was to be no final flourish for Peru.