North Carolina has been something of a progressive nightmare lately. The Tea Party takeover of the legislature and draconian cuts in welfare spending have inspired the long-running Moral Monday protests. The story on energy and climate change hasn’t been much better. Gov. Pat McCrory is a former employee of Duke Energy, the utility responsible for this year’s horrific coal ash spills. When a state study suggested rising seas would leave the Outer Banks underwater in a few decades, the state’s Republican legislature buried it.

But this grisly narrative is also masking something quite extraordinary. In the last few years, the Tar Heel State has quietly become a leader in rolling out solar. The Solar Energy Industries Association, or SEIA, notes that last year, North Carolina added 335 megawatts of capacity—the third-best tally of any state in the country. With a total of 592 megawatts of solar capacity installed, North Carolina ranks fourth among the 50 states. So far this year, according to SNL Energy, North Carolina ranks second in the number of solar farms under construction, behind only California.

Like the rest of the country, until recently North Carolina was a solar wasteland. What explains this burst of sunlight amid an otherwise gloomy weather pattern? It’s a combination of a few factors. Relatively favorable state standards have unleashed a burst of entrepreneurial energy. Progressive companies from out of state have demanded that their new facilities be powered by renewable resources, such as solar. And now that the industry has gained critical mass, it has displayed an ability to export its expertise to neighboring states.

First off, in 2007, North Carolina passed an extremely modest renewable portfolio standard, declaring that within five years, utilities must have ensured that 12.5 percent of the electricity they supply derives from renewable sources. (By contrast, California’s three largest utilities are now at about 23 percent renewables.) Like many other states, North Carolina has a renewable energy tax credit that helps bring down the cost of production. But according to Ivan Urlaub, executive director of the North Carolina Sustainable Energy Association, North Carolina’s regulatory scheme had an important wrinkle. The utilities decided to offer a deal to renewable developers: If they could develop renewable energy facilities with capacities below 5 megawatts and deliver the power below a specified cost, the utilities would agree to buy the output. Figuring that not many developers would be able to pull this off, the utilities didn’t put a cap on the program.

But a funny thing happened. “Those small regulatory rules, combined with a renewable energy tax credit, were sufficient to take what was otherwise a small market and carve out a space for entrepreneurs to jump in and compete on price and quality,” Urlaub says. The plummeting price of solar panels helped a great deal. And as a result, lots of developers took the utilities up on their offer, and 4.99-megawatt solar installations began popping up in North Carolina’s countryside.

A second powerful force came from the West Coast. North Carolina has aggressively courted big technology companies to locate data centers in the state. But many of these firms have their own agendas when it comes to energy: They want to be powered by renewable energy produced close by. So when Apple built its huge data center in Maiden, it also constructed its own 20-megawatt farm on 100 acres nearby; it has since added 20 megawatts of solar in Conover. Google, which had already spent $600 million on a data center in Lenoir, North Carolina, said it would invest another $600 million in its facilities. But Google and other companies encouraged Duke Energy to push for a so-called Green Source Rider. Under the rider, if companies pay the utility a rate slightly above the usual fee, the utility will either build renewable energy capacity itself or make deals with third-party suppliers. That has stimulated more construction.

As the industry has gained critical mass, it has also gained clout. The SEIA says $787 million was invested in solar plants in the state last year, and Urlaub says 570 green energy firms in the state employ 18,400 people. That helps explain why in 2013, when Rep. Mike Hager tried to repeal the state’s renewable portfolio standards law, it died in the committee he chaired.

North Carolina solar keeps gathering momentum. Last fall, Duke Energy Renewables and SunEnergy1 announced a plan to build three solar farms with a combined capacity of 30 megawatts in the eastern part of the state. FLS Energy in June announced it would work on a group of projects that would total 38 megawatts.

And last week saw the completion of what may prove to be the state’s biggest solar deal yet. Duke Energy signed deals with three academic institutions based in Washington, D.C. (American University, George Washington University, and George Washington University Hospital), to supply them with some 52 megawatts of capacity to be provided by three plants to be constructed in the state. The first will be located in Pasquotank County, near the Virginia border. Which is all to say that the demand from the nation’s capital is helping turn North Carolina into one of the country’s solar capitals.