Police officers in riot gear fired tear gas at protesters outside Brazil's Mane Garrincha stadium tonight.
Hundreds of people gathered to protest against the cost of putting on major sporting events, including the World Cup, which Brazil is hosting in 2014.
At least two people were injured by rubber bullets, including a 16-year-old student, AP reported.
Brazil opened the Confederations Cup with a 3-0 win over Japan on although the occasion was marred when police fired teargas at protesters outside the Mane Garrincha National Stadium.
A stunning third minute goal from Neymar set Brazil on their way before Paulinho ended Japan's challenge by adding a second three minutes into the second half of the Group A match.
Substitute Jo completed the scoring in stoppage time as the hosts, playing their first competitive match since the Copa America nearly two years ago, dealt competently with the Asian champions who created some nice moves in midfield but lacked punch.
Some fans in the 67,000 crowd had to be treated for the affects of tear gas fired by riot police at the protester who are angry at the cost of building stadiums for the tournament and next year's World Cup.
FIFA are using goal-line technology in international matches for the first time in tonight's opening match between Brazil and Japan at the Confederations Cup in Brazil.
FIFA first tested technology at a tournament in December at the Club World Cup.
The system, GoalControl-4D, uses 14 high-speed cameras located around the pitch which are directed at both goals and if successful will be used in the World Cup finals next year.
The company was selected ahead of the three other FIFA-licensed technology providers, including British-based firm Hawkeye.
Hundreds of protesters complaining against the high cost of staging the World Cup rallied in front of the Mane Garrincha in Brazil just hours before the opening match of the Confederations Cup.
Riot police were called up to keep demonstrators from getting too close to the stadium as thousands of fans arrived for the inaugural match in the nation's capital.
There was no confrontation, but a few tear gas bombs were thrown by the police to try to control the protesters as they moved near the venue.
Nearly 500 protesters participated in the demonstration. Three were seen being detained.