The Japanese four-time Grand Slam champion never looked comfortable against Osorio's dynamic shotmaking and piled up the unforced errors on a cool evening in the California desert.
After a near flawless first set from Osorio, Osaka fended off a match point at 5-3 in the second to stay alive, much to the delight of the fans.
Nerves appeared to get to Osorio as she attempted to serve out the match in the next game, where she double faulted twice and fell behind 0-40.
She regrouped, however, saving four break points in the game and crushing a forehand winner that caught the line to advance, celebrating with a dance on the court under the lights.
"First, good evening everyone, I'm Camila Osorio," she said with a laugh in an on-court interview.
"It's crazy for me, it's a dream come true. I really wanted to play on this court and was really excited and looking forwards to playing a champion like Naomi, so I can't believe it."
World number 53 Osorio becomes the first Colombian woman to beat a former world number one. She takes on 22nd seed Clara Tauson of Denmark in the second round.
It was Osaka's first match since withdrawing from the Australian Open third round due to an abdominal strain.
Osaka, who beat Daria Kasatkina in the Indian Wells final in 2018 for her first career title, appeared to struggle with the consistency of her ball tosses and accuracy off both wings.
--Reuters--