Oscar, Hernanes and Lucas scored second-half goals on Sunday as Brazil defeated France 3-0 in its final warm-up before the Confederations Cup.
Chelsea playmaker Oscar opened the scoring with a shot from close range in the 54th minute. Hernanes added to the lead with a left-footed attempt from inside the area in the 85th, and Paris Saint-Germain's Lucas sealed the victory by converting a penalty kick in injury time.
The result ended Brazil's 21-year winless run against France, and gave the "Selecao" its first victory over a former World Cup champion in nearly four years.
A two-time defending champion in the Confederations Cup, Brazil will play Japan in the tournament's opener next Saturday in the capital of Brasilia.
Brazil hasn't won a significant title since the 2009 Confederations Cup.
"It's good to finally beat a top team, but more importantly, it's good to be playing well again," Oscar said. "Hopefully we will be able to get off to a great start at the Confederations Cup as well."
The Brazilians hadn't beaten France since a 2-0 win in a 1992 friendly in Paris. In the six matches since, the teams drew twice and France won four times, including the final of the 1998 World Cup and in the quarterfinals of the 2006 World Cup.
Led by Karim Benzema but without many of its top players, France was coming off three losses in four matches this year: to Spain in World Cup qualifying, and to Germany and Uruguay in friendlies. Its only win was against Georgia.
The French are second to Spain in its World Cup qualifying group.
"We didn't have a lot of opportunities, but we had enough to get a better result," France coach Didier Deschamps said, through a translator. "It's the end of the season and that made things a bit more difficult for us. Facing Brazil here gave us a good chance to show our football."
Sunday's result marked Brazil's first win over a former World Cup champion since 2009. The last victory came against England in a friendly in Doha. Brazil has since failed to beat teams such as Argentina, Portugal, England and the Netherlands.
The Brazilians beat Argentina in 2011 and last year, but the teams were using players from local clubs.
Brazil struggled during most of Sunday's match in front of more than 50,000 at the Gremio Arena in the southern city of Porto Alegre, allowing France to create dangerous scoring opportunities from the beginning. The Confederations Cup hosts improved a bit in the second half and controlled possession after Oscar got them on the board.
Oscar's goal came after Fred gained possession near midfield and made a run through the left side before passing the ball to the Chelsea midfielder. Oscar easily found the net as the goalkeeper charged toward him.
Hernanes came on as a substitute and scored the second goal after a breakaway. Neymar set him up with a one-touch pass inside the area, and the Lazio midfielder fired a left-footed shot that struck the post before going in.
Substitute midfielder Lucas scored after Real Madrid left back Marcelo was fouled inside the area.
"It was an important victory to give us more composure as we continue on our path to try to win the Confederations Cup," Hernanes said.
Since Luiz Felipe Scolari returned to the national team in December, Brazil had previously won only won one of six matches, against Bolivia. The coach who led Brazil to the 2002 World Cup title couldn't manage more than draws against Italy, Russia and Chile. Brazil lost 2-1 to England in the coach's debut.
But Brazil was coming off a 2-2 draw with England at the new Maracana a week ago. Scolari made only one change to the starting lineup since last Sunday, replacing left back Filipe Luis with Marcelo.