ESPENHAIN, Germany -- When it opened here in 2004 on a reclaimed mining dump, the Geosol solar plant was the biggest of its kind in the world. It is so clean and green that it produces zero emissions and so easy to operate that it has only three regular workers: plant manager Hans-Joerg Koch and his two security guards, sheepdogs Pushkin and Adi.

The plant is part of a building boom that has made gloomy-skied Germany the unlikely global leader in solar-generated electricity. Last year, about half of the world's solar electricity was produced in the country. Of the 20 biggest photovoltaic plants, 15 are in Germany, even though it has only half as many sunny days as countries such as Portugal.

The reason is not a breakthrough in the economics or technology of solar power but a law adopted in 2000. It requires the country's huge old-line utility companies to subsidize the solar upstarts by buying their electricity at marked-up rates that make it easy for the newcomers to turn a profit. Their cleanly created power enters the utilities' grids for sale to consumers.

The law was part of a broader measure adopted by the German government to boost production of renewable energy sources, including wind power and biofuels. As the world's sixth-biggest producer of carbon-dioxide emissions, Germany is trying to slash its output of greenhouse gases and wants renewable sources to supply a quarter of its energy needs by 2020.

Since the Geosol plant was built, it has been eclipsed in size by six other German solar plants, including the new world's-largest, the Solarpark Gut Erlasee in Bavaria, which has more than double the capacity. Last month, construction began on yet another monster solar plant on an old military base in Brandis, about 12 miles north of Espenhain. Once completed, it will generate 40 megawatts, or enough to power about 10,000 homes.

German officials readily acknowledged that they are embracing solar technology not just for its environmental benefits. German firms that manufacture photovoltaic panels and other components have prospered under the new energy act and now employ 40,000 people. An additional 15,000 people work for companies in the solar-thermal business, which make heating systems for homes and businesses.

Matthias Machnik, an undersecretary for the German ministry of the environment, said the country can't hope to compete in the long term with perpetually sunny ones in generating solar power. But it hopes to expand its exports of solar technology and become the leader in that field as well.

"Unless climate change accelerates, we only have a certain amount of available hours of sunshine," Machnik said in an interview. "For us, of course we will use solar power, but it is more important to secure the know-how for research and development."

Last year, German exports accounted for 15 percent of worldwide sales of solar panels and other photovoltaic equipment, according to industry officials. German companies hope to double their share of the global market, which amounted to $9.5 billion last year and is growing by about 20 percent annually, said Carsten Koernig, managing director of the German Solar Industry Association, a trade and lobbying group.

"It's been very important to create the necessary market in Germany," Koernig said. "We not only want to master the German market, but to conquer the world market as well."

For now, the technology remains expensive and barely registers as a fraction of total energy production -- less than 0.5 percent. The government hopes to increase that figure to 3 percent by 2020.

Industry supporters, however, say there are other factors that favor solar production in the long term.