The decision is a blow for Spain at a time when unemployment is spiking and a steep recession is looming because of the coronavirus crisis, and the main opposition party criticised the leftist coalition government for failing the Nissan workers.
The closure of the plant and several facilities nearby also highlights the challenges carmakers face as they try to cut costs and revive demand following the global health crisis.
Nissan said it would slash its production capacity by a fifth to help reduce its fixed costs by 300 billion yen ($2.8 billion) as it looks to become smaller and more cost-efficient after posting its first loss in 11 years.
The Spanish government, which said in January after meeting officials from the Renault-Nissan alliance that jobs at the plant were "guaranteed," said it regretted the decision and urged Nissan to look at other options for the factory.
But the chairman of Nissan in Europe, Gianluca De Ficchy, told reporters that the plant had a low utilisation rate and output would not have improved even by assembling new models.
"There was no viable solution for the future of the Barcelona factory," he said, adding that two smaller Nissan plants in northern Spain would remain open.
He declined to estimate the cost of the Barcelona closure.
Nissan Chief Executive Makoto Uchida told reporters in Japan the company would discuss the situation with the Spanish government but declined to elaborate.
The plant and the nearby facilities employ 3,000 workers and the closures could indirectly affect up to 25,000 jobs, unions say. The car industry accounts for about 10% of Spain's gross domestic product, according to producers association ANFAC.
"We will continue to fight to seek to reverse this situation, we know it's very complicated," said Javier Hernandez, secretary general of the UGT union at the Nissan plant, calling the carmaker's attitude "outrageous".
About a thousand masked workers blocked the area surrounding Nissan's Barcelona plant on Thursday, first with a procession of slow vehicles, then burning a pile of tyres at its entrance and later cutting off a central road and avenue.
The closure would cost Nissan as much as 1 billion euros ($1.1 billion), the government said in a statement, arguing that investing in the factory would be a cheaper alternative for the Japanese giant.
Pablo Casado, leader of the main conservative opposition People's Party, blamed the government for the plant's closure: "The left's demonising of the automotive industry has dire consequences for our economy and employment," he tweeted.
The Barcelona plant, which has been operating since the 1980s, mainly produces electric vans and a pickup trucks and is Nissan's main European plant after one in northern England.
Workers have been on strike since early May, staging protests after Nissan only partially resumed production following a temporary shutdown due to the coronavirus.
This story has been published from a wire agency feed without modifications to the text. Only the headline has been changed.