Spain was looking to add an Olympic gold to the FIFA World Cup and European championship titles held by the country's senior national team.
But after losing 1-0 to Honduras, after an opening loss to Japan, Spain finds itself bottom of its group with no chance of progressing.
Spain was seen as one of the favourites, but is yet to score in the competition ahead of its last game against Morocco in Manchester.
Honduras moved into second place in Group D.
Brazil, seeking its first Olympic gold, went behind in the eighth minute against Belarus, but Alexandre Pato equalised with a header in the 15th after a cross by Neymar.
Neymar then scored with a right-foot shot in the 65th minute and set up the final goal for recently signed Chelsea playmaker Oscar in injury-time to make it 3-1.
The victory in front of 66,000 people at Manchester's Old Trafford Stadium gave Brazil six points in Group C, three more than Belarus.
Great Britain needed a win after drawing its first match against Senegal, and got off to a good start against United Arab Emirates when 38-year-old captain Giggs headed in a cross by fellow Welshman Craig Bellamy on 16 minutes.
Rashed Eisa nearly spoiled the party for the 82,239 fans at Wembley Stadium with an equaliser on the hour mark. But Giggs' replacement Scott Sinclair scored in the 73rd before Daniel Sturridge's perfect lob capped a win in a match watched by Prince William and David Beckham.
The win means Great Britain will progress if it doesn't lose against Uruguay in its next match in Cardiff.
Japan forward Kensuke Nagai scored an 84th-minute goal to secure a 1-0 win over Morocco.
Japan tops Group D with six points, while Morocco has one point in third place.
Mexico rebounded from a first-round loss by beating Gabon 2-0.
The win puts Mexico top of Group B with four points, while Gabon has one. The top two teams in each of the four groups advance.
Two-time Olympic champion Uruguay lost 2-0 to Senegal. The loss leaves Ururguay on three points with one game to go.
Egypt played out a 1-1 draw against New Zealand. The teams now have one point each after two rounds, so must win their next matches to have any chance of progressing.
New Zealand will next face Brazil and Egypt will play Belarus.
Korea Republic meanwhile beat Switzerland 2-1 to sit second in Group B, behind Mexico on goal difference.
Switzerland is in third position with one point, ahead of Gabon on goal difference.