Safin has plummeted down the rankings to 89th after suffering a series of injuries and had to qualify for the main draw, but hit four aces on his way to knocking out Berdych, 11th in the world, 7-5, 6-4 in 90 minutes.
The 28-year-old Russian, who was runner-up here in 2000 and 2002, is now on course to meet Carlos Moya in the 3rd round if the Spaniard beats Belgium's Oliver Rochus in his second round match.
In a day of upsets, seventh seed James Black was knocked out 4-6, 6-3, 6-3 by Serbia's Janko Tipsarevic and 13th-seed Tommy Robredo also crashed out to Croatia's Ivo Karlovic after losing 3-6, 6-2, 7-6 (7/3).
But Argentinian Juan Monaco made it through to the third round after the 12th seed breezed past Italy's Simone Bolelli 6-2, 6-1.
He will play another Italian in the third round when he faces Andreas Seppi who removed French number one and eighth seed Richard Gasquet on Tuesday.