A service station attendant in the NSW Hunter Region has had his sweet revenge, scaring off two would-be robbers by hurling bags of lollies at them.

CCTV footage captured a thief running toward the door of the service station from a vehicle with a metal bar in hand, before the attendant frantically hurls lolly bags in the direction of the robber and his accomplices.

The comical reaction seems to work as the taken-aback thief runs off to avoid being hit.

The robbery attempt happened about 5.45am last Sunday at a BP store in Aberdare.

No one was injured and police are still hunting the offender.

The man escaped in a black Hyundai i30, which was later found burnt out in Bellbird.