Toyota driver Latvala went into the final loop of the season knowing that he'd probably have to concede his lead to Tanak as part of the title showdown with Ogier.
However, the Estonian's retirement on the penultimate stage - where many drivers including Latvala had incidents - opened the door for the Finn to take his first Rally Australia victory.
It also secured the title for Ogier in his last year with M-Sport before moving to Citroen, with Thierry Neuville having already crashed out on the first stage of the loop.
Rally Australia
Rain shakes up lead battle on Rally Australia
17/11/2018 AT 08:42
He was behind Ogier due to a puncture and clipping a chicane on Friday, and he needed to be ahead to be in title contention.
Having reclaimed the lead from his team-mate through the morning loop, Latvala kept his charge going by out-pacing Tanak on the Coramba test by just over a second.
The Sapphire stage was then set to determine how Toyota would play its team orders, with hopes that the wet, slippery conditions may catch Ogier out and give Tanak a sniff at the title.
However it was Tanak that was ultimately caught out, his Yaris left stranded with a transmission issue caused by contact with a tree.
That left Latvala with a run through the final stage, Wedding Bells, where he retired from third place 12 months ago with a dramatic crash. But he held on to win by 32s over Hyundai's Hayden Paddon.
Behind the Kiwi it was Friday pacesetter Mads Ostberg in third, the Citroen driver benefiting from Tanak's retirement to end up on the bottom step of the podium despite damaging the rear of his car on the Sapphire stage.
Esapekka Lappi made sure there was more to celebrate for Toyota despite Tanak's retirement; his fourth place combined with Latvala's win gave Toyota the manufacturers' title.
Ogier had a subdued run through the final loop.
Knowing that sixth or better was enough to deny Tanak, and with Neuville crashing out before Ogier even started the first stage of the afternoon, the Frenchman could afford to tip-toe through the slippery conditions.
It wasn't until the powerstage - and with the title done and dusted – that Ogier dared to really let rip, topping a forest stage for the first time all weekend on his way to fifth overall behind Lappi.
"It is a mixed feeling at this moment," said Ogier. "I'm proud of what I have achieved and my team, they are the best.
"It has been an amazing journey together and now I just enjoyed the last push in this car.
"I hope I will not miss it."
Ogier's M-Sport team-mate Elfyn Evans finished up sixth, while Craig Breen, whose action-packed rally started with hitting a tree stump on Friday and ended with a spin on the powerstage with three offs on Sunday morning's stages alone, finished seventh in his Citroen C3 WRC.
Teemu Suninen in the third M-Sport Fiesta had been on for seventh place, but after clipping a tree during the Sapphire stage the team opted not to run his car through the powerstage.
Final result
Drivers' standings
Rally Australia
Ostberg leads after early stages of Rally Australia
16/11/2018 AT 00:42
Rally Australia
Major route revamp for Rally Australia
03/07/2018 AT 08:21