Juventino Luna, right, watches the solar eclipse with his son Jesus Luna at the Griffith Observatory in Los Angeles. (Richard Vogel/AP)

FOLSOM, Calif. — When the moon partially obscured the sun here on Monday, dozens of engineers watched from a large, gray control room outside Sacramento.

Electric grid operators at the California Independent System Operator (CAISO), which delivers 80 percent of the electricity in a state that has more solar energy capacity than every other state in the country combined, watched intently as solar generation began collapsing at 9 a.m. Pacific Time as the shadow of the moon swept from west to east across the United States.

Above them hung a wall of screens charting the 26,000 miles of high-voltage transmission lines winding through California. One screen showed the state losing half of its solar production during the morning of the eclipse before spiking back to normal. Grid operators didn’t don eclipse glasses but instead focused on the task at hand — working in a windowless room to keep the lights on elsewhere in California, without even seeing the event firsthand.

The scene offered a rare window into what might happen as the Golden State’s electric grid — and indeed the nation’s — becomes increasingly reliant on renewable sources such as solar and wind to meet Americans’ energy needs while curbing the greenhouse gases those needs generate.

Right now, solar energy provides only a small slice — slightly less than 1 percent in 2016 — of the electricity generated by utilities in the United States and nearly 10 percent in California alone. But that sliver, much as the crescent of the sun swells after a total eclipse, is only expected to grow as the price of solar panels continues to plummet.

Other states, such as North Carolina, which also sports many solar panels, had to adjust as Monday’s eclipse squeezed their energy supply for several hours.

For most, the eclipse went off without a hitch.

“Things went really, really well,” said Eric Schmitt, vice president of operations at CAISO.

The eclipse “is another in a long list of examples that show that system operators are able to integrate the current level of renewables on the grid without sacrificing reliability,” said David M. Hart, a professor at George Mason University and director of its Center for Science, Technology and Innovation Policy.

President Trump has weighed in on the side of more traditional fuels on which the nation’s energy supply has long been dependent, hoping to stoke a revival of the jobs that came with the ebbing coal industry.

The U.S. Energy Department is finalizing an overdue study of whether the national grid can handle the loss of so-called baseload power plants as older coal and nuclear plants are priced out of the electricity market by cheaper renewables.

Energy Department spokeswoman Shaylyn Hynes said the grid reliability study, which has been delayed since June, will be published “soon.”

Solar and wind advocates fear that the report may be used as a pretext to undermine federal policies that support the two nascent energy sectors — wind and solar — which many independent assessments suggest will not be a detriment to grid reliability.

Some Trump supporters argue that renewables are not something on which to build an electricity grid because their power is temporal — ebbing and flowing as the sun shines or the wind blows.

“As the utility sector prepares for the short-term impact of a solar eclipse, a much larger problem looms for solar advocates — the diminishing value of intermittent solar as a reliable source of electricity,” said Thomas Pyle, president of the Institute for Energy Research and a member of Trump’s transition team for energy.

For months, energy producers and managers along the path of totality prepared for Monday. They had the advantage of knowing the eclipse was coming instead of facing an unforeseen event in which the energy supply could be disrupted by a natural disaster, terrorist assault or cyberattack.

In California, hydroelectric and natural-gas-fired power plants, along with power drawn from seven other Western states as part of preexisting agreements, stepped in to make up for the loss of between 3,000 to 3,500 megawatts in utility-scale solar power, according to initial estimates from CAISO. For a cloudless August day, the grid operator estimated a loss of about 6,000 megawatts from both solar panels owned by homeowners and utility-scale solar facilities.

Nature helped, even if it blotted out the sun in the first place. The weather was generally mild statewide, meaning that fewer Californians probably turned on their air conditioners. And elevated reservoirs at the Helms Pumped Storage Plant in the Sierra Nevada, for example, were flush with water from the rainy season that was used to power hydroelectric pumps.

“The busting of the drought couldn’t have come at a better time,” said Lynsey Paulo, a spokeswoman for Pacific Gas and Electric.

In North Carolina, Duke Energy readied natural-gas-fired generators to make up for lost solar power in a state second only to California in total solar capacity. Although only the western toe of the Tar Heel State saw a total eclipse, Duke, the state’s main electricity supplier, lost 1,700 of its 2,500 megawatts of solar capacity at its height.

“Our system reacted as planned, and we were able to reliably and efficiently meet the energy demands of our customers in the Carolinas,” said Sammy Roberts, Duke Energy’s director of system operations.

Grid managers in California and North Carolina occasionally deal with solar dips of this magnitude. What made the eclipse more challenging than usual was the rate at which solar generation ramped down — and then ramped back up.

By coincidence, the dual rise of natural gas and solar — made possible by technological advances in hydraulic fracturing and solar panel manufacturing, respectively — complement each other. Unlike lumbering nuclear and coal-fired plants, gas-fired generators can be turned on quickly during cloudy days to meet electricity demand when solar energy is compromised.

“In a way, they’re strange bedfellows,” said Randy Wheeless, a Duke Energy spokesman.

In the coming weeks and months, grid operators hope to analyze data collected on Monday to see how electric grids that rely on wind and solar generation are affected by more common but less predictable sun-obscuring events, such as thunderstorms.

For example, the National Renewable Energy Laboratory, one of DOE’s 17 national labs whose funding is threatened under Trump’s budget proposal, used the eclipse to test forecasting simulations on two photovoltaic arrays near Denver.

Solar operators are beginning to develop weather forecasts tailored for solar generation.

“The normal weather forecast is basically used for temperature and rain,” said Charlie Gay, director of the Solar Energy Technologies Office for the Office of Energy Efficiency and Renewable Energy. “We look at how much light is reflected from clouds in order to know how much light reaches the ground.”