Barcelona's Spanish league game against Las Palmas was played without fans at the Camp Nou Stadium amid the controversial referendum on Catalonia's independence on Sunday.
Barcelona had openly backed the referendum and criticized the Spanish government for trying to impede the vote, and its president said that the decision to play behind closed doors was made by the club as a way to protest against the government's actions in Catalonia.
Barcelona won the match 3-0 with two goals by Lionel Messi and one by Sergio Busquets.
The club wanted the game to be postponed, but it said that the Spanish league refused to accept its request.
"We tried to suspend the game all day long but it wasn't possible," Barcelona president Josep Bartomeu said.
"We could lose points if we didn't play, so we decided to play behind closed doors as a way to show the entire world that we were not pleased with what happened (in Catalonia)."
More than 460 people were injured on Sunday in the northeastern region as Spanish authorities tried to stop the independence vote that the central government said was unconstitutional.
"FC Barcelona condemns the events which have taken place in many parts of Catalonia today in order to prevent its citizens exercising their democratic right to free expression," the club said in a statement.
"Given the exceptional nature of events, the Board of Directors have decided that the FC Barcelona first team game against Las Palmas will be played behind closed doors following the Professional Football League's refusal to postpone the game."
Bartomeu said police had guaranteed the safety of fans and everyone else involved in the match, and the club could have allowed them in if it wanted.
Barcelona made the closed-doors announcement with less than a half hour to kickoff, with thousands of supporters already waiting outside the stadium.
The Spanish league said there was no reason to postpone the game because of safety reasons.
Barcelona's Camp Nou, Europe's largest stadium with a capacity of nearly 100,000, is often used as a rallying point for Catalan nationalists.
Spanish media said Barcelona vice president Carles Vilarrubi resigned after the club decided to play the game under these conditions.
Las Palmas added a Spanish flag to the shirts that the players were against Barcelona to show its support for a unified Spain.
The Canary Islands club said that the match had become more than a sporting event, especially because of the recent statements by Barcelona expressing its support for the referendum.
Las Palmas said the club did not want to limit itself to being a "quiet witness at an historic crossroads".
It said that by wearing the flag it was showing its unequivocal support for a "united Spain".
Las Palmas said that even though it is based far from the mainland, it "never felt the slightest temptation to become another country".
"We are doing this to show the world that we are hurt by what is happening," the club said in its statement.