Authorities made the move on grounds they were unprofitable and in order to comply with European regulations on industrial emissions.
The move comes 18 months after Spain closed down its last coal mines, although the country remains behind on its drive to embrace renewable energies.
It also came as experts said that coal had reached its economic “tipping point” meaning it was cheaper to build renewable energy sources than to continue operating coal-fired power stations.
“It is cheaper (today) to produce (energy) with renewables than with coal,” explained Ana Barreira, head of the International Institute for Law and the Environment (IIDMA)
She said the remaining power stations could be closed down by 2025.
The decision was taken by the four Spanish electricity companies that own them — Naturgy, Iberdrola, Viesgo and Endesa, a Spanish subsidiary of Italy's Enel group — all of whom confirmed the closures.
The aim was to avoid the cost of bringing them up to date to comply with a European directive on cleaning up their emissions.
Unlike in France or Germany, the Spanish government never set a date by which such facilities were to have closed.
These power stations collectively generated 5.16 gigawatts (GW) of power, and their closure will halve Spain's coal-fired output, reducing it to 4.7 gigawatts, the “Coal-Free Future” coalition said.
June 30 was the last day of a transition period for such plants to comply with a European directive on industrial emissions.
The firms chose not to make the necessary investments because they were “no longer profitable,” said Greenpeace's Tatiana Nuno, saying the move had been in line with market demands.
Most of these plants had hardly produced any electricity in the past few months, she said.
In 2019, coal only represented 5.0 percent of Spain's total energy consumption, compared with 25 percent in 2007, the Red Electrica power grid said.
But Spain remains far from meeting its commitment to green its energy sources, with only 17.4 percent of the total coming from renewables in 2018, the latest available Eurostat figures show.
It had committed to raising that number to 20 percent by 2020.
Spain had been one of the pioneers of green energy back in the early 2000s, but its lightning development was slowed by the financial crisis that kicked off in 2008.
In recent years, there has been increasing appetite for investment in green energy given the profitability of renewables, with the development of huge solar parks and Spain now ranking the fifth in the world in terms of wind power installations.