RIO DE JANEIRO, Brazil -- Brazil came out on top in the matchup of past and present football powers on Sunday, winning its third Confederations Cup title and boosting its confidence ahead of next year's World Cup.
The hosts proved too strong for world champion Spain, cruising to a 3-0 victory at the Maracana Stadium in the match everyone had been expecting for years.
Spain did not have what it took to stop Brazil's reinvigorated team, allowing the five-time world champion to earn a resounding victory with two goals by Fred and one by young sensation Neymar.
"We played a very good match, it allows us to have a better idea about the path ahead of us," Brazil coach Luiz Felipe Scolari said. "We have a good team to play in the next World Cup."
Fred put Brazil on the board less than two minutes into the match, Neymar added to the lead just before halftime and Fred netted his fifth goal in five matches early in the second half to give Brazil victory at the World Cup warm-up tournament.
"We beat the world champions today, but we know that the tournament that we will be playing next year will be a lot more difficult," Scolari said. "Now we have more confidence, that's what we needed."
Sergio Ramos missed a penalty kick in the 55th and Spain ended the match a man down after defender Gerard Pique was sent off with a straight red card for fouling Neymar in the 68th.
Brazil came in hoping a victory would help it regain its status as a global powerhouse after recent struggles. Brazil was eliminated in the quarterfinals in the last two World Cups and hadn't won a significant title since the 2009 Confederations Cup in South Africa.
"The champion is back," chanted the crowd of more than 73,000 people at the renovated Maracana, the stadium that will host the World Cup final on July 14 next year.
It also didn't take long before the fans -- in a sea of yellow jerseys -- started teasing the Spaniards, chanting "Wanna play, wanna play!? Brazil will teach you."
The Brazilian players huddled after the final whistle and started singing and jumping, then went toward the crowd near the sidelines and began celebrating. David Luiz kneeled down and raised both of his hands into the air.
Brazil, which won its fourth Confederations Cup, has not lost a competitive home match since 1975.
The result ended Spain's 26-match unbeaten streak. Ranked first for the past 20 months, Spain hadn't lost since a 1-0 result England in a friendly in London in 2011. Its last loss in an official competition had happened 29 matches ago, in the 2010 World Cup opener against Switzerland.
Spain badly wanted a victory against the five-time world champion, which was one of the few top teams it hadn't faced since it began dominating international football. Spain won the 2010 World Cup along with the 2008 and 2012 European Championships.
Spain coach Vicente Del Bosque said it was a "deserved defeat."
"There's not much to say, they were superior on every way," he said. "They scored early. This is not an excuse but they had pressure on us all the time."
It was the first time the traditional football nations had met since a scoreless friendly in 1999. The last competitive match between the teams had been Brazil's 1-0 win in the first round of the 1986 World Cup in Mexico.
Brazil scored early on Sunday and kept pressuring, but it didn't take long for Spain to start taking control of the match. The Europeans were not able to create many dangerous opportunities, though, while Brazil kept threatening the most while relying on counterattacks.
Fred opened the scoring after a cross into the area by Hulk in the second minute. The ball bounced off Neymar near the far post and Fred, who had fallen while trying to reach for the cross, fired it in with his right foot while still on the ground.
Brazil added to the lead with Neymar's fourth goal in five matches after an exchange of passes with Oscar in the 44th. The newly signed Barcelona striker, touted as the future of Brazilian football, fired a powerful left-footed shot into the top of the net.
Neymar was voted the player of the tournament.
Neymar and Daniel Alves took the time after the match to congratulate their Barcelona teammates, who looked desolate across the field.
Fred closed the scoring in the 47th from just inside the area, sending a low shot to the far corner. Hulk started the move with a pass to Neymar, but the striker let it go as Fred came running behind him.
Spain had the penalty kick after Marcelo fouled Jesus Navas inside the area, but Sergio Ramos sent his kick wide.
Spain's greatest chance before the penalty came with Pedro Rodriguez in the 41st, when he entered the area clear from defenders in a breakaway. His low shot beat Brazil goalkeeper Julio Cesar, but David Luiz came rushing in and slid in front of the goal line just in time to keep the ball from going in.
Brazil won the its first Confederations Cup title in Saudi Arabia in 1997, then again in Germany in 2005 and in South Africa in 2009. Spain was trying to win the tournament for the first time. No Confederations Cup champion has ever won football's showcase event the following year.
Brazil struggled after Scolari returned to the national team earlier this year, winning only one of its first six matches with him in command, but it has won six in a row now.
The warm-up tournament, which gives the home country a chance to test its preparations for the World Cup, is played among continental champions plus the World Cup winner and the hosts.
There were protests outside the stadium during the match, with police using rubber bullets and tear gas to keep demonstrators from getting too close. A wave of anti-government protests has swept across Brazil in recent weeks, and many affected the Confederations Cup host cities as demonstrators complained of the costs of hosting the World Cup.
On the field, it was a heated match from the start, with players from both teams pushing and shoving each other a few times. Even the substitutes got into a shouting match.