Both of Great Britain's teams have avoided the reigning world and Olympic champions the USA in the draw for the group stage of London 2012.
Britain's men will face European champions Spain, Australia, Brazil, China and another team to be determined by an additional qualifying tournament.
The women will face Australia, Brazil, European champions Russia and two additional qualifiers in their group.
The top four teams in each group will qualify for the knockout stages.
Men's Olympic draw
- GROUP A: USA, France, Argentina, Tunisia, Qualifier 1, Qualifier 2
- GROUP B: Spain, Australia, Brazil, China,
As such, they could both still meet the US in the latter rounds.
GB performance director Chris Spice told BBC Sport: "The balls have fallen in our favour because we know what we are up against.
"We pushed the boat out for the test event last year and played Australia and China, so that has helped us. We always have tight games against Spain - Brazil remains the unknown but we will do our research on them."
"By avoiding the last two Olympic gold medal-winning sides, USA and Argentina, the men surely let out a collective sigh of relief when the draw was announced. Knowing they need to win just two of five games in the group stage to advance to the quarter-finals, they no doubt have already circled games against China and Brazil as must-win affairs.
The women weren't so fortunate - they were hoping to draw China or Angola - instead they will play both the 2008 silver and bronze medal winning teams, Australia and Russia, as well as South American champions Brazil in the group stage. Their only solace in a tough group is avoiding perennial world number one USA."
GB captain Andrew Sullivan told BBC Sport: ''I suppose it's as good as what you can hope for at an Olympics, but we are still going to be playing against quality teams. The draw makes no difference if we don't compete as well as we can."
Forward Kieron Achara, who plays professionally in Spain with Manresa, tweeted after the draw: "Not a bad group if you ask me".
Britain's teams were admitted to the Olympics as hosts, following a vote by the International Basketball Federation (known as Fiba) last year.
They were only given permission after satisfying the world governing body that they were competitive at international level and had a legacy plan for the game in the UK.
Both teams have qualified for European championship finals since 2006, the men in 2009 and 2011 and the women in 2011.
Women's Olympic draw
- GROUP A: Angola, USA, China, Qualifier 1, Qualifier 2, Qualifier 4
- GROUP B: Australia, Brazil,
Russia, Qualifier 3, Qualifier 5
GB's men have only previously played in the Olympics in the 1948 London event, while the women's squad, under Australian coach Tom Maher, will be making their debut in London.
Natalie Stafford was enthusiastic about what, at first sight, is a difficult draw. She tweeted: "Russia plus two countries yet to make it! Not a bad one!"
The matches will take place at London's Basketball Hall and the O2 Arena in Greenwich.
The three additional spots in the men's draw will be filled by an Olympic qualifying tournament to be held in Venezuela in June, where Greece, Macedonia, Lithuania, Russia, New Zealand, Angola, Nigeria, Jordan, South Korea, Puerto Rico, Venezuela and Dominican Republic will be in action.
The women's qualifying tournament, to be held in Turkey, offers five additional places with Croatia, Czech Republic, France, Turkey, New Zealand, Mali, Mozambique, Japan, South Korea, Canada, Argentina and Puerto Rico taking part.