Ferreira defeated Hrbaty, 6-4, 2-6, 6-4, for only his second win in his last nine matches. His only other match win since reaching the quarterfinals at Nottingham in June was a second-round victory two weeks ago at the Kremlin Cup in Moscow.
The 30-year-old South African is looking to become the first player ever to successfully defend here in Stuttgart. But his best results of the year came in the first half of the season, reaching the quarterfinals at the Tennis Masters Series event in Rome and the semifinals at the Stella Artois Championships.
Ferreira improved to 3-0 against Hrbaty, with whom he had been praticing with the last few days. He will next take on No. 11 Roger Federer.
Hrbaty had been playing well entering this tournament, reaching the semifinals in two of his previous three ATP events.
With the top 16 seeds gaining first-round byes, all 10 matches Monday involved only unseeded players.
Slovakian Bohdan Ulihrach and Sjeng Schalken of the Netherlands were early winners.
Ulihrach dispatched Sweden's Andreas Vinciguerra, 6-3, 6-2, to advance to a second-round encounter with U.S. Open champion Lleyton Hewitt of Australia.
Hewitt, the third seed, has won 14 straight matches, capturing his first Grand Slam in New York, going 2-0 in the Davis Cup semifinals against Sweden and winning the Japan Open two weeks ago.
Schalken downed wild card David Prinosil, 6-2, 6-4, and faces another German in the next round when he faces No. 15 Tommy Haas, who is coming off claiming his third title of the year Sunday in Vienna.
Also, Mark Philippoussis of Australia continues his comeback from a knee injury against Alberto Martin of Spain, former world No. 1 Carlos Moya of Spain encounters Nicolas Lapentti of Ecuador, and Fabrice Santoro of France plays Marcelo Rios of Chile.
In addition, Albert Costa of Spain goes against Nicolas Kiefer of Germany, Belgium's Olivier Rochus battles Belarussian Max Mirnyi, Greg Rusedski of Britain squares off against French qualifier Julien Boutter, and Alex Pretzsch of Germany, another qualifier, meets Albert Portas of Spain.
French Open champion Gustavo Kuerten of Brazil is seeded first, followed by Australian Open winner Andre Agassi of the United States, Hewitt, Spain's Juan Carlos Ferrero, and 1998 finalist Yevgeny Kafelnikov of Russia.
The winner here takes home $434,000 and 100 ranking points.