A pair of heavy machinery thieves rammed a police car and took officers on a pursuit through Sydney’s south before smashing into a garden, authorities say.

The two men had allegedly attached a trailer carrying an excavator to their black Holden Commodore in a bid to steal it from a Woolooware address before dawn on Saturday when police arrived.

One of the officers approached the rear of the car and ordered the men to stop the engine and get out.

But the driver allegedly put the Commodore into reverse and backed up quickly, forcing the officer to leap to safety.

The Commodore allegedly smashed into the police car, damaging it badly, as the men fled.

A highway patrol officer chased the men through Miranda and into Sylvania where they crashed into a garden and were arrested, NSW Police said in a statement on Sunday.

Officers allegedly found cash, heroin, mobile phones, stolen registration plates, a stolen bank card and tools used for robberies when they searched the men and their car.

The 41-year-old driver was charged with multiple offences including assaulting police, larceny, stolen motor vehicle and use of an offensive weapon to escape lawful detention.

The 38-year-old passenger was charged with steal motor vehicle and possess housebreaking implements.

They were refused bail and ordered to appear at Parramatta Bail Court on Sunday.