Team Brazil won 17 medals overall in London, two more than it did in 2008 in Beijing and in 1996 in Atlanta. It finished with the same three gold medals as in Beijing, two short of its record from the 2004 Athens Games, when Brazil was 16th overall.
"We reached our goal," said Sunday Marcus Vinicius Freire, the Brazilian Olympic Committee's top sports director. "It's within the numbers that we had predicted."
Officials had expected Brazil to win at least 15 medals at the London Games.
Yane Marques won Brazil's final medal with a bronze at the modern pentathlon on Sunday.
The highlights of Brazil's participation were the country's first gold in women's judo with Sarah Menezes in the 48-kilogram division, the nation's first medal in gymnastics with Arthur Zanetti, who won the gold on still rings, and the women's volleyball team repeating as Olympic champions.
In addition to the three gold medals, Brazil won five silver and nine bronze.
The Brazilian committee said it has already identified some of the sports in which Brazil will have to improve to try to finish in the Top 10 in Rio. The committee wants Brazilian athletes making more finals, including in swimming and athletics.
"The number of finals overall deserve our attention," he said. "We made 41 in Beijing and only 35 here."
Brazil didn't win a single medal in athletics this year, and only two in swimming — a silver for Thiago Pereira and a bronze by Cesar Cielo.
Freire said taekwondo, equestrian and men's handball also will deserve special attention in the next few years too as the sports failed to meet expectations in London. The same is true for women's basketball, women's football and women's gymnastics. He expects sailing to improve too, as only Brazil got only a bronze this time.
Among Brazil's disappointments was the silver won by Brazil's men's football team, which arrived with most of its top players and the heavy favourite for the gold. The women's team elimination in the quarterfinals, after winning the silver in the last two Olympics, also ranked high.
There were high expectations for defending world champion women's pole vaulter Fabiana Murer, but she didn't even make it to the finals. Defending Olympic long jump champion Maurren Maggi also disappointed and missed the final at the London Games.
Brazil won four medals in volleyball, but it lost both men's finals, indoor and on the beach. Boxing was a pleasant surprise with three medals, but none of them gold.
The Brazilian committee had said ahead of the games that it gave its athletes the best preparation ever, including the use of the Crystal Palace sports centre in London for its headquarters. More than $150 million were invested before the London Games, and the number is expected to increase significantly for the 2016 Games in Rio.
"To reach the Top 10 in 2016, we will need to have athletes making the podium in at least 13 sports," Freire said. "We have been reaching the podium in eight or nine sports only. We will focus on the individual sports now, in addition to our tradition of doing well in the team sports."
Follow Tales Azzoni at http://twitter.com/tazzoniSuggest a correction