Carjackers picked the wrong target when they tried to take an off duty cop's car at gunpoint.

Surveillance footage, which has just been released, showed the off-duty Chicago police officer sitting in a black BMW when two men, with their hoods pulled up, approached at around 8.45am on April 20.

The first grabs the front passenger side door and pulled it open, while reaching for something in his pocket and climbing inside.

The cop immediately got out and raised his gun as a second would-be car jacker ran round to the driver's side and climbs in the driver's seat.

Surveillance footage, which has just been released, showed two men, with their hoods pulled up, approach a car at around 8.45am on April 20

The first grabbed the front passenger side door and pulled it open, climbing inside while the cop (pictured, in white cap) immediately got out

The off duty officer (pictured) raised his gun at the would-be carjackers attempting to steal his car

The officer then began shooting at the thief on the driver's side, while the first suspect climbed back out and began returning fire

The officer then began shooting at the thief on the driver's side, while the first suspect climbed back out and began returning fire.

The cop ran for cover behind a white jeep, while the second assailant exited the car via the right passenger side and ran after his conspirator.

Both suspects fled, with the officer in pursuit, and jumped into a waiting car which immediately sped away. No one was injured during the shootout.

The incident happened just outside a barbershop,at 79th and Hamlin, where the victim was planning to get a hair cut.

The cop ran for cover behind a white jeep, while the second assailant exited the car via the right passenger side and ran after his conspirator

Both suspects fled, with the officer (circled) in hot pursuit

The cop was not able to catch up with the thieves before they jumped into a waiting car which immediately sped away

Barbershop owner Corey Felton watched the drama unfold outside his shop.

'I heard gunshots, and I just happened to look out, and my next client was outside. He was a police officer, and he was returning gunfire with a suspect,' he told CBS local.

Witness Keith Harris said he was shocked to see a shootout in broad daylight but was glad they failed to steal the car.

'They ran into the wrong guy at the wrong time,' Harris said.

Cops are still hunting for the suspects.