Justin Bieber got spanked by Zach Galifianakis for having an ''attitude''.

The 'Hangover 3' actor interviewed the 19-year-old pop star as part of his internet spoof show 'Between Two Ferns', and after Justin ridiculed his own public persona with a number of straight-faced answers, Zach took off his belt and whipped his butt with it.

The 43-year-old star began the parody Q&A on a gentler note, referring to Justin as a ''seven year old'', before going on to fire off offensive questions about the singer's ''public meltdown'', including quizzing him on him urinating in a bucket, smoking weed and his much derided entry in the guestbook at the Anne Frank Museum in Amsterdam, in which he suggested the Holocaust victim would have been a 'Belieber' if she were alive now.

By the end of the interview, Zach screeches: ''I don't like your attitude, to be quite honest. You're too young to be smoking pot and pee-peeing in buckets and driving up and down on the highway fast!

''I don't think your mum would really mind if a stranger whipped her son.''

Zach then unbuckled his belt and hit Justin three times with his accessory before returning to his seat.

He says: ''I'm sorry that I did that. I don't really think spanking kids is a good thing. But you're not a child. That's the point. You're not a child, so I can hit grown men with a belt.''

Justin enjoyed being part of the hilarious skit - which can be seen on comedy video website Funny or Die - and posted a link to the Q&A on his Twitter page.

He tweeted: ''Ladies and Gentlemen this is a very important interview. Very important ... In all honesty it might be the most important interview of this year (sic)£

Other stars to appear on 'Between Two Ferns' include Natalie Portman, Jennifer Lawrence, Anne Hathaway, Christoph Waltz, Naomi Watts, Bradley Cooper and James Franco.