Despite losing the first set, the unfanciied Israelis bounced back to win 1-6, 7-6 (7/5), 6-3 here on Wednesday.
Federer has described his gold medal victory with Wawrinka in Beijing four years ago as one of the greatest moments of his illustrious career and he was determined to mount a strong defence of the title.
But the seven-time Wimbledon singles champion and his partner, seeded sixth at the Games, were unable to emulate their Chinese triumph as the Israeli pairing fought back on Court 18.
Federer could at least take consolation from reaching the quarter-finals of the Olympic singles, achieved with a victory over Uzbekistan's Denis Istomin earlier on Wednesday.
Results on Wednesday:
Men
Singles
Third round
Roger Federer (1), Switzerland, def. Denis Istomin, Uzbekistan, 7-5, 6-3.
John Isner (10), United States, def. Janko Tipsarevic (7), Serbia, 7-5, 7-6 (16/14).
Kei Nishikori (15), Japan, def. David Ferrer (4), Spain, 6-0, 3-6, 6-4.
Juan Martin del Potro (8), Argentina, def. Gilles Simon (12), France, 6-1, 4-6, 6-3.
Nicolas Almagro (11), Spain, def. Steve Darcis, Belgium, 7-5, 6-3.
Andy Murray (3), Britain, def. Marcos Baghdatis, Cyprus, 4-6, 6-1, 6-4.
Jo-Wilfried Tsonga (5), France, def. Feliciano Lopez, Spain, 7-6 (7/5), 6-4.
Novak Djokovic (2), Serbia, def. Lleyton Hewitt, Australia, 4-6, 7-5, 6-1.
Doubles
Second Round
Jonathan Erlich and Andy Ram, Israel, def. Roger Federer and Stanislas Wawrinka (6), Switzerland, 1-6, 7-6 (7/5), 6-3.
Marin Cilic and Ivan Dodig, Croatia, def. Johan Brunstrom and Robert Lindstedt, Sweden, 6-3, 6-2.
Marcelo Melo and Bruno Soares, Brazil, def. Tomas Berdych and Radek Stepanek (5), Czech Republic, 1-6, 6-4, 24-22.
Michael Llodra and Jo-Wilfried Tsonga (2), France, def. Leander Paes and Vishnu Vardhan, India, 7-6 (7/3), 4-6, 6-3.
Women
Singles
Third Round
Victoria Azarenka (1), Belarus, def. Nadia Petrova (16), Russia, 7-6 (8/6), 6-4.
Angelique Kerber (7), Germany, def. Venus Williams, United States, 7-6 (7/5), 7-6 (7/5).
Serena Williams (4), United States, def. Vera Zvonareva (13), Russia, 6-1, 6-0.
Caroline Wozniacki (8), Denmark, def. Daniela Hantuchova, Slovakia, 6-4, 6-2.
Kim Clijsters, Belgium, def. Ana Ivanovic (11), Serbia, 6-3, 6-4.
Maria Sharapova (3), Russia, def. Sabine Lisicki (15), Germany, 6-7 (8/10), 6-4, 6-3.
Petra Kvitova (6), Czech Republic, def. Flavia Pennetta, Italy, 6-3, 6-0.
Maria Kirilenko (14), Russia, def. Julia Goerges, Germany, 7-6 (7/5), 6-3.
Doubles
Second Round
Chuang Chia-Jung and Hsieh Su-Wei, Taiwan, def. Flavia Pennetta and Francesca Schiavone (7), Italy, 6-7 (3/7), 7-5, 6-4.
Quarter-finals
Liezel Huber and Lisa Raymond (1), United States, def. Ekaterina Makarova and Elena Vesnina (6), Russia, 6-3, 6-3.
Mixed Doubles
First Round
Victoria Azarenka and Max Mirnyi (1), Belarus, def. Angelique Kerber and Philipp Petzschner, Germany, 6-2, 6-2.
Lisa Raymond and Mike Bryan (3), United States, def. Sara Errani and Andreas Seppi, Italy, 7-5, 6-3.
Gisela Dulko and Juan Martin del Potro, Argentina, def. Elena Vesnina and Mikhail Youzhny, Russia, 6-3, 7-5.
Samantha Stosur and Lleyton Hewitt, Australia, def. Agnieszka Radwanska and Marcin Matkowski (4), Poland, 6-3, 6-3.
Roberta Vinci and Daniele Bracciali, Italy, def. Sofia Arvidsson and Robert Lindstedt, Sweden, 6-3, 4-6, 1-0 (10/8).