The decision came despite government efforts to keep the plant open, Foreign Minister Arancha Gonzalez Laya told the national radio station.
“We regret this decision by Nissan to leave not just Spain but Europe… to concentrate its business in Asia, despite the enormous efforts by the government to keep the business going,” she said.
Spain's car industry is the European Union's second-biggest after that of Germany, accounting for 10 percent of the country's GDP.
The industry ministry confirmed to AFP that Nissan's chief executive had informed it of its plan to stop operations at the Barcelona site, which groups several production facilities.
Production there had already ground to a halt at the start of the month when some staff went on strike demanding an investment strategy for the site after plans were announced to cut 20 percent of its workforce.
Foreign Minister Gonzalez Laya said “all kinds of help” had been proposed to Nissan in the run-up to Thursday's decision and that the government would “not throw in the towel”.
Instead it would “explore all solutions, because our concern is to safeguard employment”. She did not rule out the possibility of finding a buyer for the plant.
Economy Minister Nadia Calvino meanwhile said the government had invited Nissan to start talks “to see how this process could be managed”, to no avail.
The Madrid government has argued that the cost of closing Nissan's Barcelona operation, which it put at more than one billion euros ($1.1 billion), was higher than the investment needed to keep it going.
When the news broke, workers gathered at the gates to the factory and staged a protest, burning tires.