Japanese No.1 Osaka handed the eight-time champion her first-ever loss before the fourth round in Miami.
Also, it was only the fourth time when Serena was eliminated of any tournament in the first round.
After the match, Osaka said Serena has been her childhood idol and she was feeling the nerves before her first-ever match against the former world No. 1.
"She's the main reason why I started playing tennis, and just, I have seen her on TV so many times and I have always been cheering for her, so for me to play against her, and just sort of trying to detach myself a little bit from thinking that I'm playing against her and just try to think I'm playing against just a regular opponent was a little bit hard for me," Osaka said.
This was Serena's fourth match since ending a 15-month absence during which she gave birth to daughter Alexis Olympia Ohanian Jr.
She struggled to find her mark as she hit 28 unforced errors to just 16 winners in the match overall.
Earlier, Serena was ousted from the Indian Wells Masters after going down against elder sister Venus Williams in the third round of the tournament. (ANI)