The fifth-seeded Williams was two points from victory several times in the second set, including leading 5-1 in the tiebreaker. But Razzano won six straight points to force a third set, and then took control of the match.
"I made so many errors today, which isn't the game I was playing in the past," Williams said. "That's life."
Williams entered the day with a 46-0 record in first-round matches at Grand Slam tournaments. She had been looking for her 14th major title, and second at Roland Garros.
The 13-time Grand Slam champion had five break points in the final game, but she couldn't convert.
"I was just thinking, if I can break here we'll be back on serve," Williams said.
Razzano saved all five, and then converted her eighth match point to eliminate one of the tournament favorites.
"I had to dig deep against a great champion and you could see until the end that she gave away nothing," Razzano said. "I had to go and get the victory. I had to be mentally strong, and I gave my everything."
Earlier, Rafael Nadal began his quest for a record seventh French Open title in style, wearing a pink shirt and pink shoelaces.
He won easily, too.
The second-seeded Spaniard had little trouble against Simone Bolelli of Italy, winning 6-2, 6-2, 6-1 on Court Philippe Chatrier -- the same stadium where Nadal has won six of his 10 Grand Slam titles.
Nadal, who is tied with Bjorn Borg with six French Open titles, improved his record to 46-1 at Roland Garros. His only loss came in the fourth round in 2009, against Robin Soderling.
He's not worried about the record just yet, though.
"We are in the second round," Nadal said. "I have enough work to do thinking about the next round, and not think about if Bjorn will be here or if I'm going to play the final. That's day-by-day and we'll see."
Against Bolelli, Nadal made only 18 unforced errors, fewer than half as many as his opponent. From 2-2 in the first set, Nadal won eight straight games to take control.
"I think I did what I had to do today," Nadal said. "I played probably with less stress or nerves than in other first rounds in the past."
And after a short blip in the second set, Nadal won eight of the last nine games.
"I tried to play aggressive with the forehand, with the serve, but today I miss a lot," Bolelli said. "He's strong. I mean, I didn't have a chance to make the match even."
Fourth-seeded Andy Murray also advanced, beating Tatsuma Ito of Japan 6-1, 7-5, 6-0.
Maria Sharapova was nearly perfect in her match, winning all 12 games to produce a "double bagel." And Wimbledon champion Petra Kvitova advanced by beating junior Wimbledon champion Ashleigh Barty 6-1, 6-2.
Sharapova routed Alexandra Cadantu of Romania 6-0, 6-0 on Court Suzanne Lenglen, needing just 48 minutes to advance to the second round. She finished the match with 18 winners, while Cadantu had zero, but had to save three break points.
"No matter how good or bad they're playing, you still have to win that match," Sharapova said. "It's always about who takes their chances."
Sharapova, who lost in this year's Australian Open final, is looking to complete a career Grand Slam by winning the title at Roland Garros.
The Russian has won the other three Grand Slam titles, but she has never reached the final at Roland Garros. Last year, however, she equaled her best result by making the semifinals.
"I feel like with every year I have improved and I enjoy it much more," Sharapova said. "I think I learn a lot more about the game and the point construction. I feel like I'm moving a lot better than I did years previously, which has helped me a lot in the recovery process within the point."
She moved well enough against Cadantu, a 22-year-old Romanian who was making her French Open debut.
"For me, to have that big crowd, it was a lot," Cadantu said after playing on the second biggest stadium at Roland Garros. "I enjoyed it a lot."
Kvitova lost the opening game in her match against the 16-year-old Barty, but then won six straight in the first set and again raced through the second set despite being broken once.
"She has a big serve with kicks and good forehand," Kvitova said of the Australian teen. "She has very good touch."
The left-handed Czech won her first Grand Slam title at Wimbledon last year, and then won the WTA Championships. Although she has yet to win a title in 2012, she is seeded fourth at Roland Garros and is expected to make it deep into the tournament.
Barty is the youngest player in the draw at the French Open, one of only eight teenagers entered. The Australian received a wild-card invitation to compete in Paris.
"It was tough out there today," Barty said. "I didn't play my best tennis, but she didn't allow me to. I was out there giving it my all, but unfortunately just didn't come out on top today."
The oldest player in the draw, 41-year-old Kimiko Date-Krumm of Japan, lost to 2010 French Open champion Francesca Schiavone of Italy 6-3, 6-1.