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.

Plans for a laser fusion plant have been drawn up at UKAEA in Culham. The Hiper project would use two lasers to produce power from seawater and lithium, an abundant element.

"When this works, it will immediately change the future energy map for the world," said John Parris at the Hiper project. "A single cubic kilometre of seawater contains enough deuterium to supply an amount of energy equal to the entire world's oil reserves". That would overturn concerns over energy security caused by vast amounts of the globe's oil been locked up beneath a small number of nations.

The NIF facility must overcome major technical hurdles before scientists can start celebrating. The laser at the heart of the facility can only fire a handful of times a day. In between each shot, the hydrogen fuel pellet needs to be replaced. Over the coming years, scientists want to see improvements that allow the facility to run continuously. That could mean firing the laser 10 times a second, at fuel pellets that are shot mid air as they are dropped into the fusion chamber.

• This article was amended on 1 July 2009. The original quoted John Parris at the Hiper project as saying: "One cubic kilometre of sea water has the fusion energy equivalent of whole world's oil reserves." This has been corrected.