James Corden has responded to criticism that he copied a joke originally made by Ricky Gervais, saying he delivered the gag “obviously not knowing” it came from the comedian.

During Monday’s episode of his US talk show The Late Late Show, Corden addressed Elon Musk’s Twitter takeover by telling a joke that went viral on social media – but not for the reasons he might have hoped.

It was noted that the gag was remarkably similar to one told by Gervais in his 2018 stand-up show Humanity, with one Twitter user splicing footage of both for comparison.

Gervais, 61, remarked on Corden’s joke in a since-deleted Twitter post, telling a follower he took it down as he “started to fell sorry for him”.

During his show, Corden said: “When you see Elon Musk talk about Twitter he does this thing where he goes, ‘Well, it’s the town square’.

“But it isn’t. Because if someone puts up a poster in a town square that says ‘guitar lessons available’, you don’t get people in the town going, ‘I don’t want to play the guitar! I want to play the piano, you piece of s**t!’

“Well, that sign wasn’t for you, it was for someone else. You don’t have to get mad about all of it!”

More on James Corden

Responding to the accusations, Corden, 44, tweeted from The Late Late Show account to say he had “inadvertently told a brilliant Ricky Gervais joke on the show last night, obviously not knowing it came from him”.

Gervais retweeted the post after defending Corden earlier in the day in a conversation with another Twitter user who asked if the star had asked for permission to use the joke.

“No. I reckon one of the writers ‘came up with it’ for him,” Gervais replied. “I doubt he would knowingly just copy such a famous stand-up routine word for word like that.”

It is the second time Corden has gone viral online in recent weeks, after a dispute with the owner of Balthazar restaurant in New York for alleged bad behaviour.

Read more:
James Corden explains restaurant row

The star was briefly barred from the restaurant after its owner, Keith McNally, claimed he had been “extremely nasty” to his staff on two occasions.

Corden later addressed the incident during an episode of The Late Late Show and said it was “never my intention” to upset staff – but acknowledged he had been “ungracious”.

In April, the star announced he would be stepping down as host of The Late Late Show in 2023 after presenting it from Los Angeles since 2014.

He is best known in the UK for co-writing and starring in the sitcom Gavin And Stacey.