Image copyright Getty Images Image caption Owens will appear in 10 episodes of Tyler Perry's drama

Geoffrey Owens, the Cosby Show star who was "job shamed" after being spotted working in a grocery, has taken Tyler Perry up on his offer of a TV role.

Perry's spokeswoman said Owens will appear in 10 episodes of his drama The Haves and the Have Nots, which is broadcast on the Oprah Winfrey Network.

The show follows three families based in Savannah, Georgia - two are wealthy and powerful and one is poor.

Owens played Elvin Tibideaux in The Cosby Show, which aired from 1985-92.

Writer and director Perry based The Haves and the Have Nots on his 2011 play of the same name.

He offered Owens a role after photos of the actor working as a cashier at Trader Joe's were mocked online.

A customer's snapshots of Owens bagging groceries in New Jersey were published by the Daily Mail and Fox News, leading to accusations of "job-shaming".

Actors and celebrities rushed to defend the actor, which Owens told ABC was "really overwhelming, in a good way".

Owens - who has also worked on TV shows It's Always Sunny in Philadelphia and That's So Raven - said he had worked at Trader Joe's in Clifton, New Jersey, for 15 months.

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.