Riot police fired tear gas as demonstrators threw missiles near the Maracana football stadium.
President Dilma Rousseff did not attend the match. She was booed at the opening of the tournament.
The protests started nearly a month ago, sparked by transport fare rises, but quickly encompassed other issues.
The main grievances are over the costs of staging the World Cup, corruption and demands for better health, education and transport.
Earlier on Sunday a group of demonstrators tried to storm a Brazilian Football Association (CBF) building in Rio. But police kept them back and the group settled outside the building.
The protesters demanded the resignation of CBF president Jose Maria Marin, who has been accused of incompetence.
In a separate protest, several thousand people marched on Maracana stadium banging drums.
They demanded free public transport, carrying placards reading “FIFA – you pay the bill”. The demonstrators also called for and end to corruption and the resignation of the Rio State governor.
Minutes before the game began, small groups of protesters threw rocks and firecrackers at police lines.
Security forces responded with tear gas and sent armored vehicles to disperse the demonstrators. There were no further incidents during the game – which saw Brazil beat Spain 3-0.
The wave of protests began nearly a month ago in the city Sao Paulo after bus fares were increased by 10%.
But after heavy-handed police action, it spread to other cities and mobilized public opinion.
The rises in Sao Paulo and many other Brazilian cities were revoked after two weeks of protests.
By then, the demonstrations had turned into a nationwide movement for better education, healthcare and transport.
IMrj55uvz6IAt least five people, including a four-month-old baby, have been killed after dozens of tornadoes…
Harvey Weinstein has been hospitalized just days after his 2020 rape conviction in New York…
Hamas has published a video showing the first proof of life of US and Israeli…
Prosecutors and Donald Trump’s attorneys delivered opening statements and the first witness was called on…
The House of Representatives has finally approved $61 billion in new US military aid for…
The real estate market in the United States has always been a gauge for economic…