Struggling with a chronic hip injury, three-time Grand Slam champion Murray had the Melbourne crowd roaring when he came back from two sets down before losing 6-4 6-4 6-7(5) 6-7(4) 6-2 in just over four hours.
"If this was my last match, it was an amazing way to end," the 31-year-old Scot said. "I gave everything I had -- it wasn't enough tonight."
In an emotional news conference on Friday, Murray said the Australian Open could be his last tournament but after the match he left ajar the door for a return next year.
"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," he added.
Defending champion Federer cruised into the second round with a 6-3 6-4 6-4 win over Uzbek Denis Istomin.
Nadal, 17 times a Grand Slam winner, powered past local hope James Duckworth 6-4 6-3 7-5 to kickstart his campaign.
American John Isner became the first top-10 player to bite the dust when he was stunned by compatriot Reilly Opelka 7-6(4) 7-6(6) 6-7(4) 7-6(5).
The victory was world number 97 Opelka's first in the main draw of a Grand Slam.
In the women's draw, Caroline Wozniacki started her title defence with a 6-3 6-4 victory against Belgian Alison van Uytvanck.
World number two Angelique Kerber moved into the second round with a 6-2 6-2 victory over Slovenia's Polona Hercog, while Maria Sharapova raced past British qualifier Harriet Dart in a 6-0 6-0 win.
Brave Murray bows out of Australian Open after epic comeback
Federer serves up dominant first-round win against Istomin
Champion Wozniacki through to second round with comfortable win
Dimitrov bets on coach Agassi for Grand Slam breakthrough
Kerber untroubled as Australian Open campaign gets underway
Seamless Nadal drubs Australian Duckworth in Melbourne opener
Sharapova doles out dreaded double bagel to Dart
Sharapova pans male players for fighting women's equality
Boulter wins deciding set shootout after premature celebration
Next generation men to watch out for in Melbourne
Halep faces tricky test against Kanepi in Melbourne opener
Australian Open order of play on Tuesday
Highlights of Monday's opening day of the Australian Open, the first grand slam tournament of the year (all times GMT):
1210 FEDERER EASES PAST ISTOMIN IN OPENER
Roger Federer, chasing a third consecutive Australian Open title, eased past Uzbek Denis Istomin 6-3 6-4 6-4 in the opening round.
The 37-year-old Swiss will face British qualifier Dan Evans, ranked 189 in the world, in the second round.
1205 MURRAY BOWS OUT AFTER FIVE-SET BATTLE
Five-time finalist Andy Murray produced an inspired comeback in what could have been his final match but was eventually beaten by Spain's Roberto Bautista Agut 6-4 6-4 6-7(5) 6-7(4) 6-2.
The former world number one had announced on Friday that he could be forced retire this year due to a chronic hip problem.
0955 CHAMPION WOZNIACKI BREEZES THROUGH
A dominant Caroline Wozniacki scythed down Belgium's Alison Van Uytvanck 6-3 6-4 in 93 minutes to get her title defence off to a strong start.
The Dane, seeded third, hit four aces and won two out of seven break points in a controlled display to down her unseeded opponent and set up a match with Johanna Larsson.
0915 PETKOVIC COLLAPSES ON COURT BEFORE CONCEDING MATCH
Andrea Petkovic was forced to retire from her opening match against Romania's Irina-Camelia Begu after collapsing on court during the eighth game of the second set.
The tournament's trainer and doctor were immediately called to treat the German who trailed in the second set after winning the opening set 7-6(3).
Petkovic eventually got back on her feet and played another point before calling it a day.
0743 FIT-AGAIN BERDYCH BEATS EDMUND
Tomas Berdych, back to full fitness following a back injury, defeated 13th seed Kyle Edmund 6-3 6-0 7-5 to move into the second round in style.
The Czech, a runner-up in the Qatar Open this month, is participating in only his second tournament since the Queen's Club championships last June but showed no signs of the problem as he dismantled Briton Edmund.
Up next for Berdych is Robin Haase, who beat Guillermo Garcia-Lopez 7-5 6-4 7-5.
0707 DIMITROV ENJOYING AGASSI MENTORSHIP
Grigor Dimitrov said having eight-times major champion Andre Agassi in his corner as coach had not just sharpened his game but also improved his outlook on life.
"I'm just a better person, period. On a daily basis, I have learned something new from him," Dimitrov, who began working with the American great last October, said following his win over Janko Tipsarevic.
"Sometimes some of the things he says... it has nothing to do with tennis. And today before the match we are talking about completely different stuff.
"I was, like, 'Oh, that feels nice.' I think he also keeps me on point, keeps me on check. He's just trying to remind you of the good things in life."
0615 BATTLING ISNER FALLS TO UNSEEDED OPELKA
Ninth seed John Isner was stunned by his American compatriot Reilly Opelka, who secured a 7-6(4) 7-6(6) 6-7(4) 7-6(5) victory in a tight encounter between the towering pair.
Opelka, ranked 102 in the world, moved into the second round of a Grand Slam for the first time.
0540 KERBER IN CRUISE CONTROL
Wimbledon champion Angelique Kerber hardly broke sweat in her clinical 6-2 6-2 victory over unseeded Polona Hercog. Up next for the world number two is Brazilian qualifier Beatriz Haddad Maia who beat Bernarda Pera in three sets to advance.
0531 OSTAPENKO DUMPED OUT BY SAKKARI
Jelena Ostapenko's poor start to the season continued as the 2017 French Open champion was knocked out in the opening round at Melbourne by Greece's Maria Sakkari.
Ostapenko, eliminated in the first round in her previous three tournaments, was beaten 6-1 3-6 6-2 by world number 41 Sakkari who scored her first career win over the Latvian to the delight of a noisy contingent of her compatriots.
0416 DIMITROV RALLIES PAST TIPSAREVIC
Bulgaria's Grigor Dimitrov dropped the opening set tamely but regained his composure to power past unseeded Janko Tipsarevic 4-6 6-3 6-1 6-4.
Dimitrov, who struggled with an ankle injury towards the end of last season, hit 42 winners but also made 43 unforced errors during the victory.
0408 STEPHENS MAKES SHORT WORK OF TOWNSEND
Big-hitting American Sloane Stephens relied on accuracy instead of power, winning 69 percent of points on her first serve to ease past compatriot Taylor Townsend 6-4 6-2.
0404 NADAL TOO GOOD FOR DUCKWORTH
World number two Rafa Nadal swatted aside Australian wild card James Duckworth 6-4 6-3 7-5 in a performance that eased concerns over his fitness ahead of the season's first major.
The 2009 winner had pulled out of the Brisbane International warmup with a thigh strain but showed no signs of the problem in his opener, beating Duckworth in two hours and 15 minutes.
He faces Matthew Ebden or Jan-Lennard Struff next.
0332 ANDERSON EASES PAST MANNARINO
Wimbledon runner-up Kevin Anderson fired 14 aces and 47 winners to blast past Frenchman Adrian Mannarino 6-3 5-7 6-2 6-1 and move into the second round.
The towering South African, who has never gone beyond the fourth round in Melbourne, next meets unseeded American Frances Tiafoe, who beat qualifier Prajnesh Gunneswaran 7-6(7) 6-3 6-3.
0118 SHARAPOVA 'DOUBLE BAGELS' DART
Former champion Maria Sharapova opened the quest for her second title at Melbourne Park with a 6-0 6-0 victory over British qualifier Harriet Dart.
The 22-year-old Briton saved two match points but blasted a backhand volley wide to give the Russian a rare 'double bagel' victory in 63 minutes.
0015 PLAY UNDERWAY AT MELBOURNE PARK
Play got underway on schedule under sunny skies at 11 a.m. local time (0000) GMT with the temperature hovering just over the 25 degrees Celsius mark and a forecast high of 35C. (Compiled by Greg Stutchbury, Shrivathsa Sridhar and Hardik Vyas, editing by Nick Mulvenney/Amlan Chakraborty/Clare Fallon)
(This story has not been edited by Devdiscourse staff and is auto-generated from a syndicated feed.)