Police have praised the actions of a truck driver who was forced to brake heavily to avoid hitting a bus carrying schoolchildren in Sydney's south-west.

In dramatic CCTV footage released by police, the bus, with 15 children on board, can be seen pulling out onto the M5 in front of the truck at Hammondville near Liverpool.

Police said the truck driver was forced to brake heavily to avoid a collision, causing the truck to jack-knife.

No-one was injured in the incident just before 8:00am on Thursday.

Detective Inspector Dean Johnstone from Liverpool Local Area Command said it could have been catastrophic.

"His actions are certainly worth being praised, he's certainly prevented what could have been [a] very catastrophic incident on the M5," he said.

Passing motorists flagged the 59-year-old bus driver down and police have spoken to him as part of their investigations into the incident.

"There's no doubt that it was a mistake and it was an error of judgment by the bus driver however the potential consequences of that incident, as I said, would have been catastrophic," Detective Inspector Johnstone said.

The bus driver is expected to be charged.