An Australian man has been charged after he allegedly stole a bulldozer and tried to flatten a home while a family was still inside.

Police in New South Wales responded to a call around 7 a.m. Monday about a man driving a bulldozer over four cars on a property in the town of Teralba.

He then drove the vehicle toward a detached garage where a 29-year-old man was sleeping but then "turned the bulldozer toward the house, before continuing over the building until it was demolished," police said in a news release.

The rampage finally ended when an officer smashed in the window to the bulldozer's cabin and emptied a can of pepper spray "to subdue the driver," and another office pressed the emergency stop button.

A 56-year-old woman and her two daughters, 15 and 20, were able to flee the home safely with the help of a neighbour.

No one was injured, police said.

A 48-year-old man, who the Daily Telegraph identified as Jamie Sager, is charged with 11 offences, including destruction of property with intent to endanger life and stalking.

Police said the suspect is known to the residents of the home. The Telegraph said he is a former friend of homeowner Mark Fraser, who wasn't there at the time.