A man has shamed a litterbug driver for throwing her cigarette butt on a Perth road, with the footage attracting mass support on social media.

The video of the man throwing the discarded butt back in the window of the car was captured on a dashcam camera on Thursday afternoon and quickly went viral, commenters calling the man a “hero”.

Magnus Hand shared the video on Facebook group Dash Cam Owners Australia, where it has attracted over 200,000 views and 1300 comments.

The footage shows a car stopped at traffic lights before something is thrown from the window by the driver.

Mr Hand then walks up beside the car, picks up the cigarette butt and confronts the driver.

He then walks back to his car.

“So, I was at the lights and this poor lady’s cigarette accidentally fell out of her hand onto the road,” Mr Hand wrote.

“Being the gentleman I am, I got out picked up the cig and kindly returned it to her.”

“Not all heroes wear capes. Some waddle around like a duck. Well done mate,” wrote one commenter.

“Wish we had of seen her face … Priceless! This guy is a legend!”

Littering in Western Australia is illegal and carries different penalties. Dropping a cigarette butt that’s extinguished from a private vehicle is likely to cop you a fine of $200.

However, if you work for a company and you’re in your company car, the fine is $500.

And as some commenters on the post pointed out, if the discarded cigarette is lit and could have caused a fire, the maximum penalty is $5000.

Littering can be reported online via relevant council websites.