A train company has apologised after members of the public were disturbed from their sleep in the early hours of Sunday morning by a “horrendous” noise.

The “loud metallic banging”, which echoed around Borehamwood, began at about 2am and did not finish until 6am.

Residents complained the noise sounded like gun fire at first then fireworks, before becoming consistent.

Members of the public took to Twitter to complain about the mysterious racket, which was later traced to Network Rail.

Caused by a piling hammer used to drive in foundations for new overhead power lines, the noise is part of engineering work that will be carried out on Saturday nights and Sunday mornings until June.

Lesley Cook, who lives in Furzehill Road, was woken at 2am.

She said she had received no notice the work was going to happen and originally had no idea what the noise was.

She said: “By 3am it was driving us all mad.

“I found out via Twitter that it was pile driving on the railway line, and is apparently going to continue on Saturday nights/Sunday mornings for nine months.

“We live about a mile from the lines, so goodness knows how the people living closer felt.

“This is not only intolerable, but totally unacceptable. I feel really awful, not having had any sleep. 

“What about people with young children, or someone who is unwell and needs their sleep?”

Oliver Shoffren tweeted: “Thanks @networkrail for NO notice about the loud banging in Borehamwood. Awake for hours last night this must stop not go til June #complaint.”

Lisa Collins tweeted: “Thanks for the sleepless night! @networkrail Lots of tired & grumpy people today #borehamwood.”

Paul Woolfson tweeted to Network Rail: "What the hell were you doing at 4am in Borehamwood. My household was awoken by a constant thumping."

Network Rail had sent out letters giving information about the "vital" engineering work to residents living along the railway line.

However a spokesman for Network Rail admitted, given the noise, the company should have informed more members of the public about the work.

The spokesman said: “The work we are doing in Elstree and Borehamwood is vital to improving the reliability of the railway through the area, replacing an outdated system of overhead electric supply with a more modern and reliable version.

"However, replacing this system is a big job and requires some serious engineering - including digging new foundations (piles) before we start. Because the railway operates during the day, we have to do this ongoing work at night.

"While we have written to our neighbours living along the line, we realise that we should have done more to reach people in the area and apologise to anyone affected.

"We will be doing more to explain the project to residents."

He added although there would be work in the area for some months, it would take a variety of forms and would certainly not be so loud.