Neymar will play for Brazil at the Rio de Janeiro Olympics but will skip the Copa America, Barcelona said Wednesday.
The news was announced by the Catalan club after it trounced Deportivo La Coruna 8-0 in the Spanish league, with Neymar netting one of the goals to end the forward's five-game scoreless run.
Neymar had said he wanted to play in both tournaments and the Brazilian soccer confederation had asked for his release. But Barcelona didn't want to lose the striker for so long and feared that his participation in both events could affect his preparations for next season.
The confederation and the club had been in talks for several months before finally reaching a deal.
"FC Barcelona expresses its gratitude to the Brazilian Football Confederation and its president Marco Polo del Nero for accepting the Club's proposal for Neymar Jr to only play at the Olympic Games in Rio de Janeiro this summer, and not at the Copa America in the United States," Barcelona said in a statement.
Clubs are not obliged by FIFA to release players for the Olympics, but had to do so for the Copa America Centenario in the United States.
The Olympics will be played from Aug. 3-21, while the Copa America runs from June 3-26.
The Olympic tournament is played with under-23 squads and only three overage players are allowed in each team. The 24-year-old Neymar will be one of the three overage players in the squad coached by Dunga.
The Olympic gold medal is the only significant trophy Brazil has never won. Neymar was the main star in Brazil's squad that lost the final to Mexico in the 2012 Olympics in London.
Brazil is in Group A at the Olympic tournament in Rio, along with South Africa, Iraq and Denmark. It opens against South Africa on Aug. 4 in Brazil's capital of Brasilia.
Neymar on Wednesday scored the last of Barcelona's eight goals against Deportivo in La Coruna. The victory ended a four-game winless streak and kept the team ahead of Atletico Madrid and Real Madrid in the Spanish league with four rounds to go.