A tentative first step towards an era of clean, almost limitless energy will take place today with the opening of a giant facility designed to recreate the power of the stars in an oversized warehouse in California.

The $3.5bn National Ignition Facility (NIF) sits in a 10-storey building covering three football fields and will harness the power of lasers to turn tiny pellets of hydrogen into thermonuclear energy.

If the machine works as planned, it will become the first to generate more energy than it consumes, a feat that could pave the way for commercial laser fusion power stations and an end to the world’s energy security problems.

The building, which has taken almost 15 years to build and commission, is due to be opened in a ceremony attended by the US energy secretary, Steven Chu, and the California governor, Arnold Schwarzenegger, who has said the facility could “revolutionise our energy future”.

“If they’re successful, it will be a very big deal. No one has achieved a net gain in energy before,” said Derek Stork, assistant technical director at the UK United Kingdom Atomic Energy Authority (UKAEA)’s centre for fusion research in Culham, Oxfordshire.

Inside the building, scientists will use the world’s most powerful laser to create 192 separate beams of light that will be directed at a bead of frozen hydrogen in a violent burst lasting five billionths of a second. Each fuel pellet measures just two millimetres across but costs around $40,000, because they must be perfectly spherical to ensure they collapse properly when the laser light strikes.

The intense beams produce a powerful shockwave that crunches the fuel pellet at a million miles an hour, generating temperatures of around 100,000,000C. Under such extreme conditions, which are found only in the core of stars, the hydrogen atoms will fuse, producing helium and vast amounts of energy.

The facility will gradually work up to full power over the next 12 months or so, but experiments are scheduled to run until around 2040.

If the NIF succeeds, politicians will be under pressure to invest in the technology to develop a first generation of demonstration plants to feed fusion energy into electricity grids.