Frightening footage of a near-miss between a bus carrying 14 school children and a truck on Sydney’s M5 has been released by police, who say it’s lucky no one was killed.

The CCTV footage shows a bus allegedly pulling out in front of a semi-trailer on the busy motorway at Hammondville in Sydney’s outer south-west during the Thursday morning school run.

The truck driver had to brake heavily, causing his vehicle to jack-knife in order to avoid a collision, consequently sending up plumes of smoke from his tyres.

“The truck driver did extremely well,” NSW Police Chief Inspector Greg Tetley told 2GB on Friday.

“It could have been potentially fatal.”

Passing motorists flagged down the 59-year-old male bus driver after the incident and has been interviewed by police.

M5 Near Miss: "14 students were on the bus at the time….they are all fine" – Janine Kenny – Principal – Mount Saint Joseph – Milperra. pic.twitter.com/p31JMFbINE — 7 News Sydney (@7NewsSydney) June 2, 2017

The unnamed driver spoke to Seven News to apologise for his actions and admitted he had made a “mistake decision”.

No children were hurt in the incident.

The truck driver is also helping police in their investigation.

Police want witnesses to the incident to contact them.

—AAP