MADRID - Brazil overcame Cuba 72-67 in the final of the women's Olympic Qualifying Tournament to take the last place available for the Beijing Games on Sunday.
They join the four quarter-final winners, Spain, Czech Republic, Latvia and Belarus, who beat them after overtime on Friday.
Brazil, who were fourth at the Athens Olympics in 2004, suffered a dramatic bust-up after that game when coach Paulo Bassul kicked his captain Iziane Castro Marques off the team for refusing to come on in overtime.
They went on to hammer Angola 75-58 without her in their playoff semi-final on Saturday.
Cuba, who beat Japan in their semi, pushed Brazil all the way in the final and were leading by five with four minutes to go.
But Brazil stormed back with Micaela Jacintho finishing with a game-high 22 points.
"It's a great moment and the girls deserve this," said Bassul. "I think it is a wonderful group and basketball is all about the group."
The five qualifiers join hosts China, world champions Australia, gold medal holders United States, Mali, Korea, Russia, and New Zealand for the Olympics in August.