Nadal, bidding for a fourth straight major title to complete a non-calendar year Grand Slam, carved out a 6-2, 7-5, 6-3 win but it took him 2hr 30min to finally subdue the 199-ranked youngster in a far from one-sided contest.
The Spanish top seed will now play Croatia's 15th seed Marin Cilic in Monday's round of 16 after stretching his Grand Slam winning streak to 24 matches.
Nadal, who applauded Tomic from the court, said the young Australian had the ability to become a future rival.
"Congratulations to him, every year he is improving and he has a big chance to be in the top positions," he said.
"He makes you play bad and it was difficult to move him off the baseline. I had to go to the net more more because I didn't have the shots from the baseline to destroy him."
Tomic, at 18, is the youngest man to reach the Australian Open third round since Nadal made it through to the same stage in 2004 aged 17 years 243 days.
But he was far from intimidated by playing the nine-time Grand Slam champion in front of a capacity home crowd at Rod Laver Arena and displayed the talent that could potentially make him a future top-line player.
Tomic broke Nadal's service twice, showed courage to fight off 12 break points and frequently had Nadal on the defensive in an impressive performance against the world's leading player.
Nadal took some time to work out Tomic's unique, languid style and broke the Australian teen twice in the third and seventh games to dominate the opening set.
But the promising Tomic hit some terrific flat forehands and it took the world number one 44 minutes to go one set up.
Tomic brought a roar from the capacity home crowd with a double break of Nadal's serve to race to a 4-0 lead in the second set.
The Spaniard quickly broke back when Tomic's concentration lapsed, giving Nadal his chance to strike and trail 4-1.
Tomic was dictating the rallies with the world number one, whose red shirt was saturated by his exertions.
But Nadal clawed back another break after the young Australian double-faulted on break point and levelled the game scores by winning a 33-shot rally.
Tomic's inexperience cost him a third service break with a forehand error to leave Nadal serving for a two sets to love lead after another intense struggle over 55 minutes.
It took Nadal 12 minutes to fight off four break points in the fourth game of the final set as Tomic refused to give in.
But the Spaniard continued to play at his maximum and wrapped up the contest when he broke Tomic's serve in the ninth game.