The fifth seed and last year’s finalist was shocked 6-3, 7-5 in the first round by the world number 78 in just under two hours on Rod Laver Arena.
It means for the first time since 1997 there will be no Williams sister in the second round at Melbourne Park after Serena pulled out following the birth of her daughter.
The last time it happened Steffi Graf was world number one and Bencic was still two months away from being born.
Bencic, who lost to Serena in straights sets at the same stage last year, said when she saw the draw she was prepared for another tough opener.
“I would like to have played someone easier,” she admitted. “When I was a little girl watching on TV I would never imagine I would play them.”
There was no sign of the drama to come until the seventh game when former world number seven Bencic, in form again after winning the Hopman Cup warm-up team event in Perth alongside Roger Federer, broke the Williams serve.
She then had to hold off an immediate fightback from the veteran American, saving five break points in an attritional game before a passing rain shower caused a 20-minute delay as the roof on Rod Laver Arena was closed.
They resumed with Bencic serving at deuce and the Swiss then crucially reeled off the next two points for 5-3 before breaking Williams again to take the opener 6-3.
Williams departed for a bathroom break and, seemingly refreshed, struck back at the start of the second, breaking Bencic’s opening service game.
But the Swiss was not to be denied and put the pressure back on the Williams serve and levelled on her third break point.
Bencic, who made her WTA Tour debut as a 14-year-old against Williams in Luxembourg in 2012, had never beaten the seven-time Grand Slam winner in four previous meetings.
And deep into the second set Williams was coming under constant pressure on her serve and, serving at 3-4 and 15-40, needing all her experience to reel off four points in row to level again.
But Bencic was not to be denied, coming from 0-30 on the Williams serve at 6-5 with the help of a ferocious backhand winner to get to match point and secured a famous victory.
Download our app and read this and other great stories on the move. Available for Android and iOS.