Serena Williams' dreams of a fairytale finish to her glittering career were left in ruins on Friday as the tennis icon was sent crashing out of the US Open by Australia's Ajla Tomljanovic.

The 40-year-old Williams -- who last month signalled she planned to retire after the Open -- was beaten 7-5, 6-7 (4/7) 6-1 by Tomljanovic in a gruelling 3-hour 5-minute battle.

Williams, a sporting and cultural icon who amassed 23 Grand Slam singles titles in her 27-year career, poured everything into one last stand in front of a ferociously partisan crowd at the Arthur Ashe Stadium.

But the veteran wilted visibly in the decisive third set, wearied by the demands of a heroic second set display that saw her level the match in a tie break.

As Tomljanovic raced into a 5-1 lead in the third, Williams summoned every last drop of her fighting spirit to stave off defeat, saving five match points in a marathon seventh game before finally succumbing.

Afterwards Williams saluted the crowd, welling up as Tina Turner's anthem "Simply the Best" belted out around the stands.

Asked by an on-court interviewer whether there was any possibility she might yet extend her career, she replied: "I don't think so, but you never know."

"It's been a fun ride," she said. "It's been the most incredible ride and journey I've ever been on, I mean, in my life.

"I'm just so grateful to every single person that's ever said, 'Go, Serena,' in their life. I'm just so grateful. You got me here."

Williams reserved special praise for her parents Richard Williams and Oracene Price who had set her and her elder sister Venus on the path to superstardom.

"It all started with my parents," Williams said. "They deserve everything. So I'm really grateful for them."

Williams also paid tribute to her sister who looked on from the stands.

"I wouldn't be Serena if there wasn't Venus, so thank you, Venus. She's the only reason that Serena Williams ever existed," she said.

Tomljanovic meanwhile expressed disappointment that Williams' career was likely over.

"I'm feeling really sorry just because I love Serena just as much as you guys do," she told the crowd. "What she's done for me, for the sport of tennis, is incredible.

"I never thought I'd have a chance to play her in her last match when I remember watching her in all those finals, so this is a surreal moment for me."

Tomljanovic said she had also never felt certain of victory.

"Even to the last point, I knew that she's in a position to win even when she's down 5-1," she said.

"That's just who she is and she's the greatest of all time. Period."