A man has been arrested after a "very deliberate" attack in which he allegedly set himself on fire and tried to drive into a police station in western Sydney.

About 7pm on Thursday, police noticed a man aged in his 60s parked in the driveway of Merrylands police station, Assistant Commissioner Denis Clifford said.

As they approached the vehicle, it ignited and the man drove it down the driveway, ramming the roller door of the underground car park, Mr Clifford said.

The officers extinguished the blaze and pulled the injured man from the car. Paramedics took the man to Royal North Shore Hospital suffering "very serious burns" to the front of his body.