Gimeno-Traver, 29, the world No 62, was in no way overawed by the occasion as he met Federer for the first time with the Swiss eventually pushing through to win 7-6 (7-3) 6-7 (5-7) 6-3.
Federer showed exquisite touch at times but the Spaniard put up strong resistance.
The 17-times Grand Slam winner was kept in check in a tight first set, only moving ahead in the tie-break which he took with a gorgeous backhand crosscourt dink that ravished the crowd.
Playing with aggression and abandon, Gimeno-Traver raced to a 5-2 lead in the second set but Federer pegged him back to force another tie-break.
Against the odds, Gimeno-Traver raised his game once more with some impressive shot making, taking the breaker 7-5 when Federer tamely pushed a service return into the net.
But Federer showed his class in the final set, taking it 6-3 despite showing signs of frailty on his serve as Gimeno-Traver??forced him to save four break points.