Croatian Mirjana Lucic-Baroni, a former phenom now a 32-year-old veteran who had to fight through qualifying, shocked second-seeded Halep, the French Open runner-up, 7-6 (8/6), 6-2.
"It's incredible, amazing, I feel goofy," said Lucic-Baroni, who reached a Grand Slam fourth round for the first time since making it to the 1999 Wimbledon semi-finals as a 17-year-old.
The reward for the 121st-ranked Lucic-Baroni is a fourth-round meeting with 13th-seeded Italian Sara Errani, who thwarted Williams 6-0, 0-6, 7-6 (7/5).
Bencic, the 2013 Wimbledon and French Open junior champion, now ranked 58th in the world, earned a meeting with former world number one Jelena Jankovic, a 6-1, 6-0 winner over Sweden's Johanna Larsson.
After dropping the lopsided first set, Kerber appeared poised to knot the match, but she couldn't convert three set points.
Bencic, coached by former Swiss great Martina Hingis' mother Melanie Molitor, seized her chance.
"It's amazing that after last year I played juniors here, and this year I'm in the fourth round," Bencic said. "So it's incredible."
The last Grand Slam of the year has now lost four of its top 10 women's seeds, after the second-round departures of Agnieszka Radwanska and Ana Ivanovic.
- Errani holds off Venus -
Errani's triumph over 19th-seeded Williams wasn't strictly speaking an upset, but the 13th-seeded Italian had to dig deep to notch her first career victory over the American after three defeats.
"I know that was a really tough match, even if I won the first set 6-0 she's an amazing player," Errani said.
And as she expected, seven-time Grand Slam champion Williams battled back, racing through the second set to set up a third that turned into a slugfest.
Williams twice came back from a break down in the third, then broke Errani to serve for the match at 5-3.
She couldn't hang on, however, surrendering her serve as they battled to the tiebreaker, in which Errani took a 5-2 lead only for Williams to battle back to 5-5 before at last succumbing.
Errani was thrilled by the electric atmosphere in the Ashe stadium, even though she knew the frantic fans were for her opponent.
"Was unbelievable good," she said of the cheers ringing out as Williams had a chance to even the tiebreaker at 5-5. "I think I will remember forever that moment."
Sharapova also found herself in a power struggle, but emerged with a 6-2, 6-4 victory over German 26th seed Sabine Lisicki in a match which finished after midnight.
Both women had more unforced errors than winners -- Sharapova by 32 to 20.
In a match that saw nine breaks of serve, Sharapova broke Lisicki in the final game to clinch the win when the German fired a forehand out on Sharapova's third match point.
"It was a really tough opponent I had today, a very aggressive, big server," Sharapova said. "I just tried to concentrate on my return, I wasn't serving as well as I wanted to."
China's Peng Shuai, showing no sign of a let-down after her second-round win over Radwanska, dispatched another seeded player in number 28 Roberta Vinci 6-4, 6-3.
She set up a meeting with 14th-seeded Czech Lucie Safarova, a 6-3, 6-7 (5/7), 6-4 winner over France's Alize Cornet.
- Federer into third round -
Men's second-round action was comparatively tame.
Second-seeded Roger Federer found a way past the booming serve of Sam Groth in a 6-4, 6-4, 6-4 second round victory over the 104th-ranked Australian.
"My arm's still vibrating," Federer said after coping with Groth's 140-plus mph (225.31 Km/h) serves.
Fourth-seeded David Ferrer reached the third round without lifting his racquet when unpredictable Aussie Bernard Tomic withdrew with a hip injury.
Sixth-seeded Czech Tomas Berdych needed five sets but got the job done against Slovakian Martin Klizan 6-3, 4-6, 6-2, 3-6, 6-3 and Wimbledon semi-finalist Grigor Dimitrov of Bulgaria continued his best-ever US Open with a 6-1, 6-2, 6-2 victory over Israeli Dudi Sela.
Austrian Dominic Thiem rallied from two sets down to defeat 11th-seeded Latvian Ernests Gulbis 4-6, 3-6, 6-4, 6-3, 6-3, but 12th-seeded Frenchman Richard Gasquet, Croatia's 14th-seeded Marin Cilic, 18th seed Kevin Anderson of South Africa, 19th seed Feliciano Lopez and 20th seed Gael Monfils all advanced.