A good Samaritan has rescued a man from a burning car at Heatherbrae overnight.

Police say a 28-year-old man was driving a Mazda 3 on the Pacific Highway just before 7.30pm on Tuesday when he lost control and slammed into a telegraph pole.

The man was trapped behind the wheel as the car burst into flames.

A brave passer-by managed to pull the man from the car – he was treated at the scene by paramedics before being taken by road ambulance to the John Hunter Hospital in a serious but stable condition.

The cause of the crash is being investigated.