At 1 p.m. on a cloudless Sunday last month, the price of electricity on Spain’s wholesale market was minus 4 euros a megawatt-hour. The sun was shining on 42 gigawatts of solar panels, the country was using about half that much power, and anyone willing to take the surplus was, briefly, paid to do so.

Spain has recorded about 1,300 hours of zero or negative wholesale prices so far in 2026, more than in any previous year and more than any other large European market. Solar capacity has nearly tripled since 2021, driven by some of the cheapest build costs in the world and a permitting rush that peaked before stricter rules took effect last year. The result is an electricity system that is close to free in the middle of a sunny day and close to normal in the evening, when the panels go dark and gas plants set the price.

For the companies that built the panels, the arithmetic has turned. The “captured price” for solar generators, the average they actually receive, fell to about 23 euros a megawatt-hour this year against a market average of 58 euros, according to Álvaro Peñalver, an energy consultant in Madrid. Projects financed in 2022 on the assumption of 45 euros are missing their debt covenants. “The panels did exactly what they were supposed to do,” Mr. Peñalver said. “They were so good at it that they destroyed their own market.”

Helios Ibérica Renovables, a Seville developer with about 2 gigawatts in operation, has paused construction on three projects and is renegotiating loans on four. “Every bank in Spain financed the same business plan at the same time,” said Inmaculada Roldán, its chief executive. “Nobody modeled what happens when everybody succeeds.”

The surplus is also being wasted. Grid operators curtailed about 9 percent of Spain’s potential solar output this year because there was nowhere to send it, and interconnection with France, the obvious outlet, remains limited to about 3 gigawatts, a tenth of what Spain can produce at noon. Batteries would solve much of the problem by moving midday power to the evening, and the government has set a target of 5 gigawatts of storage by 2028. About 1.4 gigawatts exist today.

The beneficiaries are the companies that can move their consumption to the middle of the day. Cerámicas Vallés, a tile maker in Castellón with 380 employees, has shifted its kilns to run hardest between 11 a.m. and 4 p.m. and says its energy bill has fallen 31 percent in two years. “Our competitors in Italy pay twice what we do,” said its production director, Ramón Esteve. “Ten years ago they said Spain’s problem was expensive energy. Now the problem is that it is cheap at the wrong time.”

The blackout that darkened the Iberian Peninsula in April 2025 sharpened the debate about how much solar a grid can absorb without more storage and more flexible generation. The grid operator has since required new solar plants to provide voltage support and has accelerated connection approvals for batteries. Developers say the measures are sensible and slow.

Ms. Roldán said her company had stopped bidding for new solar sites and was bidding only for storage. “The sun was the easy part,” she said. “The sun was always going to be the easy part.”