A boat loaded with fireworks has exploded in front of shocked onlookers, forcing the many families watching on a beach just metres away to evacuate.

Thousands had packed the foreshore at Terrigal, on the NSW central coast, to watch the 9pm spectacular when the boat suddenly caught alight.

Two fireworks technicians on the boat were forced to jump into the water and swim for their lives as the fireworks began to explode.

Shocking video taken by an onlooker caught the moment a large bang erupted from the boat, drawing scared screams from the crowd and forcing people to evacuate.

A barge loaded with fireworks has exploded in front of shocked onlookers at Terrigal, on the NSW central coast, forcing those gathered to watch the display to evacuate

Fireworks began exploding at random, with some even shooting out in the direction of the beach and coming perilously close to those gathered.

Within seconds of the display starting the boat was covered in smoke as fireworks began firing out at random.

Witnesses reported some fireworks shooting horizontally across the water towards those who had gathered on the sand. There have been no reports of injuries.

'Barge on fire and fireworks going everywhere,' tweeted one shocked local who was watching the display.

Scared children who had taken up a vantage point close to the waters edge could be seen running in the opposite direction to the fireworks.

Screams reverberated around the beach as the thousands gathered began running for safety.

The fire brigade was called to put out the blaze, with others at the scene describing it as 'chaotic'.

Thousands had packed the foreshore at Terrigal, on the NSW central coast, to watch the 9pm spectacular when disaster struck