With the Brazilian women beating the United States 3-1 in their final, the men looked on course to head to their home games in Rio in 2016 as defending champions too, opening up a 2-0 lead over Russia.
But the Europeans became the first side in men's Games history to overturn a two-set final deficit and leave with the top prize.
Their semi-final victims Bulgaria were beaten in the bronze medal match by an Italy side carried by the brilliant serving from Cristian Savani - the tournament's fourth top-scorer with 106 points. Russia's Maxim Mikhaylov led the way for the Games with 148.
All four sides would have been credible winners, though, seeing off the challenges of the likes of Poland and the defending champions the United States on the way. They were both quarter-final casualties, as were Argentina and Germany.
Australia, Great Britain, Serbia and Tunisia all went home after the group stages, with the hosts and the latter both failing to win a game.
In the women's tournament, Brazil beat the United States in the final.
Smarting from their Beijing loss to the same opponents they recruited the men's gold-winning coach of Hugh McCutcheon and seemed to have found the right formula, with his new-look side sweeping all before them thanks to the brilliance of 161-point Destinee Hooker and Foluke Akinradewo (95).
But they crumbled under the pressure of chasing a first-ever Olympic win, being swept aside 3-1 after taking the opening set to 11.
It was a significant victory for a Brazil side who will be hosting the Games next time around, for they had looked set to depart at the group stages when they were beaten in successive matches by the States and South Korea.
But, initially held together by Sheilla Castro (140 points) and the defensively-incredible Thaisa Menezes (110), they scraped through before inflicting a first defeat of 2012 on Russia in the quarter-finals and beating Japan in the semis.
Japan would still win a medal, though, taking bronze by seeing off South Korea in the play-off match. With Kim Yeong-koun, the tournament's top-scoring player with 207, obviously battle weary, Japan were able to produce a routine 3-0 win.
In the round-robin stages the Games said goodbye to Algeria, Great Britain, Serbia and Turkey, although the host nation did achieve the honour of becoming the first British team to win an Olympic match.