Mahmoud Ahmadinejad appeared to show a more than passing knowledge of rap music on Monday, quoting the late Tupac Shakur in the latest of a series of surprising tweets from the former Iranian president.

His tweet referred to the US Black Panther Party on the anniversary of the African-American revolutionary organisation's foundation in 1966.

People have reacted to his decision to join Twitter and share his personal opinions on the social media platform, which was banned in Iran under his administration, leading many Iranians to use proxy servers in order to access Twitter.

Since his maiden tweet last year announcing he’d joined Twitter, Ahmadinejad has written a number of tweets critiquing US President Donald Trump as well as blaming "Zionists" for distracting from "real issues" in the United States.

He made comments during the spat between basketball player LeBron James and Trump after the LA Lakers star called the president a “bum”. Trump responded stating that he preferred Michael Jordan to LeBron. Ahmadinejad tweeted this:

Ahmadinejad’s sporting commentary didn’t end there. He also addressed the French Open’s plans to change its dress code for female tennis players after their disagreement about what Serena Williams decided to wear during the tournament.

Why is the #FrenchOpen disrespecting @serenawilliams ? Unfortunately some people in all Countries including my Country, haven't realized the true meaning of freedom.

Social media users were quick to point out that under his presidency, Iranian women were arrested if they appeared in public with their heads uncovered.

The headscarf is still compulsory for women in public in Iran, and dozens of women have been arrested after removing their hijabs in public in a wave of protests.

Dude you are forcing hejab on iranian women, making them wear long mantoos in 40c heat. Some women don’t want to cover themselves, your regime forces an islamic uniform on them. You are not the defender of freedoms