Image copyright Twitter Image caption Ambassador John Casson is known for his 'relaxed' tone on Twitter

Jokes about a country's politics aren't what you might expect from a typical ambassador, but a wry comment by Britain's representative in Cairo has landed him in hot water.

John Casson doesn't really fit the serious, formal stereotype of a British ambassador - he's young, has a relaxed manner, and is fond of making jokes. His style has won him admirers in Egypt and more than 18,000 followers on Twitter. But some think he went too far on Wednesday when he tweeted about a job opening at the British Embassy - and included a pointed reference to an Egyptian political controversy.

"Do you want to work at the British Embassy?" he tweeted in Arabic. "We welcome all applicants, even the sons of rubbish collectors."

That last bit was a reference to recent controversial comments by Egypt's justice minister, Mahfouz Saber. When he was asked in an interview whether the son of a rubbish collector could be made a judge, Saber said that the judiciary should be "lofty and have status" and that judges had to come from "a respectable milieu". The interview prompted an outcry in a country where an entrenched system of patronage was one of the factors that brought millions of Egyptians onto the streets to oust Hosni Mubarak in 2011. The outrage spread so quickly that earlier this week, Saber resigned.

Image copyright Twitter/ John Casson Image caption The tweet that angered many Egyptians

Even though Casson's tweet seemed to mock the same system that Saber was defending, many Egyptians took to Twitter to accuse the ambassador of "fishing in muddy waters" - in other words, sticking his nose where it doesn't belong.

"Meddling in Egyptian internal affairs is not acceptable, not even jokingly," tweeted one Egyptian. Another tweeted: "They occupied our country for years and killed our people and made us poor and they think they have the luxury of making fun of us" - a reference to British rule which ended in 1952. An Arabic hashtag which called for Casson to be expelled has been used thousands of times. But other Egyptians took a different view. After all, one commented, "it was a joke". Another expressed his exasperation at the current government: "Expel the British Ambassador from Egypt…and expel me with him please".

And others saw an opportunity to express their frustration at other issues, such as the difficulty of obtaining a visa to visit the UK. "Would you give the son of garbage collector a tourist visa though? Or the son of any other Egyptian?" one asked.

So far Casson hasn't said anything further on the controversy. Britain's Foreign and Commonwealth Office (FCO) told the BBC that they encourage ambassadors to "make creative use of social media to engage people in the countries they are working in."

"The specific comment was a show of support for the idea that an individual's family background should not prevent them from applying for any job. We have a very talented group of local staff in Cairo and we hope this generates even more interest amongst local communities to join us in building strong ties between the UK and Egypt," the FCO said.

Here are some of Ambassador Casson's most popular tweets

Image copyright Twitter Image caption "This site is playing with us people": the ambassador jokes about an ancient sculpture and a website designed to calculate a person's age

Image copyright Twitter Image caption He's also a fan of Koshari, the dish of pasta, rice, chickpeas, onions and lentils that is a much-loved Egyptian street food.

Image copyright Twitter Image caption ... and the tram in Alexandria

Blog by Mai Noman

Next story: "Take us with you, Scotland" say thousands in North of England

You can follow BBC Trending on Twitter @BBCtrending, and find us on Facebook. All our stories are at bbc.com/trending.