Page 2 of 2 Previous
But Spain had not played Brazil since a 1999 exhibition, and they hadn't met in a competitive match since the Selecao's 1-0 win in the first round of the 1986 World Cup in Mexico.
"We knew we were going to encounter a physical game with lots of fouling," Spanish midfielder Andres Iniesta said. "We lost to a very strong team, and the small details let us down."
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, shot with his right foot while still on the ground.
Brazil added to the lead after Neymar exchanged passes with Oscar and then sent a powerful left-footed shot over goalkeeper Iker Casillas.
Fred got the final goal 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 was awarded the penalty kick after Marcelo fouled Jesus Navas inside the area. Ramos, who skied a penalty kick for Real Madrid against Bayern Munich in the 2012 Champions League semifinals, sent this one wide.
Spain's best chance before the penalty came with Pedro Rodriguez in the 41st, when he entered the area clear from defenders on a breakaway. His low shot beat goalkeeper Julio Cesar, but David Luiz came rushing in and slid in front of the goal line just in time to deflect the ball over the crossbar.
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.
"We played a very good match," Scolari said. "It allows us to have a better idea about the path ahead of us."