WATCH: Quick-thinking tradie traps alleged would-be carjacker inside his ute

An alleged would-be carjacker has found himself in a tight spot after being trapped in the vehicle of his intended victim.

Shortly after 5pm on Friday, plumber Carlos Sabag was driving his ute at Haymarket in Sydney’s CBD.

As he reached an intersection, police allege Ian Hamilton opened the passenger door of Mr Sabag's ute and climbed in.

Amateur video captured the struggle to subdue the accused. Photo: Supplied
Amateur video captured the struggle to subdue the accused. Photo: Supplied

Hamilton allegedly punched Mr Sabag in the face several times and demanded to be driven to Wagga Wagga, about 450 kilometres away.

Several bystanders came to Mr Sabag's aide and helped drag him out of the ute.

Thinking quickly, Mr Sabag then remotely locked the ute's doors, trapping the alleged offender inside.

One witnesses waved down police who attempted to arrest the alleged failed thief.

An officer was allegedly punched in the face before police used capsicum spray to subdue the man.

The alleged attempted carjacking occurred in front of dozens of witnesses. Photo: Supplied
The alleged attempted carjacking occurred in front of dozens of witnesses. Photo: Supplied

Hamilton, 39-year-old from Ashmont, near Wagga Wagga, was arrested and charged with aggravated assault with intent to take/drive a motor vehicle, assaulting police and resisting arrest.

He was refused bail at Parramatta Local Court on Saturday and is due to reappear in court on Wednesday.

Mr Sabag was not seriously hurt and was back at work on Saturday.