The International Basketball Federation finalised the two groups for the Beijing Games men's tournament minutes after Germany won the final qualifying spot with a win over Puerto Rico.
Germany and Greece, who qualified at the weekend, will play in Group B which already includes Angola, hosts China, world champions Spain and a US team eager to regain the top Olympic spot after winning bronze four years ago.
Croatia, the third qualifier, is drawn in Group A alongside 2004 Olympic champions Argentina, Australia, Iran, Lithuania and European champions Russia.
The top four teams from each group go through to the quarter-finals.
The men's competition starts on August 10, two days after the Games open and ends on August 24, the final day of the Games.