The Briton, who is hoping to play at Wimbledon, battled brilliantly before losing 6-4, 6-4, 6-7 (5-7), 6-7 (4-7), 6-2, BBC Sport reported.
Murray, 31, struggled early on but had the Melbourne Arena crowd roaring as he took the third and fourth sets.
"If this was my last match, it was an amazing way to end," he said.
"I gave everything I had – it wasn't enough tonight."
Murray, a three-time Grand Slam champion, said on Friday he would retire this year because of a chronic hip problem.
However, he did suggest in his on-court interview that there was still a chance he could return to Melbourne.
"Maybe I'll see you again. I'll do everything possible to try," said an emotional Murray after an epic match which lasted four hours and nine minutes.
"If I want to go again, I'll need to have a big operation, which there's no guarantee I'll be able to come back from anyway, but I'll give it my best shot."
Federer, Nadal through
Defending champion Roger Federer is into the second round after beating Uzbek Denis Istomin.
The Swiss, who has won the tournament six times, came through 6-3, 6-4, 6-4 and will play Britain's Dan Evans next.
Meanwhile, 17-time Grand Slam winner Rafael Nadal beat James Duckworth 6-4, 6-3, 7-5 to reach the second round.
John Isner became the first top-10 player to fall on the opening day as he was stunned in four sets by world number 97 Reilly Opelka.
American Isner, seeded ninth in Melbourne, was beaten 7-6 (7-4), 7-6 (8-6), 6-7 (4-7), 7-6 (7-5) by compatriot Opelka in just over three hours.
The victory was Opelka's first in the main draw of a Grand Slam.
Opelka – who at 6ft 11ins is the joint-tallest player on the ATP Tour – is the first American to beat 6ft 10ins Isner at a Slam.
New serve 'worked well'
Spanish second seed Nadal, 32, saw off Australian Duckworth in two hours and 16 minutes on Rod Laver Arena, despite a stubborn finish from Duckworth.
"He was playing super aggressive, every shot," said Nadal.
Nadal, who cut short his 2018 season with an abdominal muscle injury and to have ankle surgery, appeared to be back to full fitness against wildcard Duckworth.
The world number two showed no sign of being bothered by a thigh strain that had forced him to pull out of the Brisbane International earlier this month.
He was delivering a remodeled serve, which worked well even if he was broken to love when serving for the match at 5-3 in the third.
"When I get broken [it] was not because of the serve," he said.
"When you play against a player that wants to hit all the shots, of course you can have breaks against, because you are sometimes in his hands,
"But anyway, my serve worked well. I don't know my percentage, but [there were] a lot of good positions after the first serve. I felt solid with the second."
He won 74 percent of first-serve points and delivered six aces.
Nadal will play Australian Matthew Ebden in the second round.