The match went to tie-breaks in both sets, with Stepanek -- ranked 27th in the world -- beating the top-seeded and world No. 1 Federer 7-6 (7-4), 7-6 (9-7).
It was the Czech's first win against Federer since 2002.
In the second set, Stepanek served at 4-2 and 5-3 and Federer went on to fail to qualify for a final for the sixth time in seven tournaments.
"You have to get him on a day when he is so-so," the 29-year-old Stepanek said. "But I'm happy with the win. There is no better win than to beat No. 1 player in the world."
In other quarterfinal action Friday, sixth seed Andy Roddick beat No. 14 Tommy Robredo 6-3, 4-6, 7-6 (7-4), advancing to a semifinal match against qualifier Stanislas Wawrinka, who upset eighth-seed James Blake 6-7 (5-7), 7-6 (7-5), 6-1.