Mahmoud Ahmadinejad is shown addresses the United Nations General Assembly in 2010. (Richard Drew/Associated Press)

Mahmoud Ahmadinejad had used his surprisingly active Twitter presence to opine about U.S. sports a few times already, but those takes involved episodes in which global superstars such as LeBron James and Serena Williams overlapped with political or sociological concerns. On Tuesday, the former hard-line Iranian president was back to talk sports, but this time he was offering fairly straightforward encouragement to . . . Michigan football?

That’s right, Ahmadinejad was of the expressed opinion that with “a hard work ethic,” the Wolverines' program “will return to its glory days.” Helpfully, lest any Twitter user see the tweet and think the sentiment was coming from the likes of Colin Cowherd or Lee Corso, Ahmadinejad added “Inshallah,” Arabic for “God willing.”

Ahmadinejad’s tweet came in reply to a Michigan fan who himself was responding to a tweet posted by the former president in early September, when he pointedly noted that the NFL season was about to kick off without “one of the best quarterbacks in the league”: Colin Kaepernick.

Fred Zimmerman, the Michigan fan who sparked the exchange, said to The Post via email Wednesday that when he noticed his Twitter notifications “scrolling rapidly” and realized it was because of Ahmadinejad’s tweet, “I was afraid that I might have stumbled into making a political gaffe.” However, Zimmerman said he was quickly “reassured” when he saw that the ex-president’s comment was “inoffensive and for that matter on key."

“Like everyone else I was and am a little bit boggled that he knew to refer to Michigan as ‘U of M’ and call out the ‘glory days,’” added the 57-year-old Ann Arbor resident, who first attended a Wolverines game in 1966. “As far as I can tell from his biography he has no U.S. educational connections so [I] wonder if perhaps someone in his circle does.”

Not surprisingly, Ahmadinejad’s willingness to engage on such a seemingly mundane sports topic led other Twitter users to pepper him with more queries. “It was great seeing all the responses scroll in,” Zimmerman said, “and that most people got the joke — saw the absurdity of dialoguing with an Iranian politico offering his perspective on a quintessentially American sport.”

As of this writing, Ahmadinejad had not responded to any of those important questions — unless, of course, he was hitting people up in their DMs — but moments before his Michigan tweet, he replied to a user who had criticized him as having “forced” Iranian women to wear hijabs and other garments. The context was an August tweet in which Ahmadinejad called out French Open organizers for saying they would ban the type of catsuit Williams wore in the tournament, with the ex-president saying, “Unfortunately some people in all countries, including my country, haven’t realized the true meaning of freedom.”

After the Twitter user said, “You are not the defender of freedoms,” Ahmadinejad denied forcing anyone “to do such a thing,” and he ended his tweet with the hashtag, “#Dude,” in reference to having been called that by the user.

Iran’s president from 2005 to 2013, Ahmadinejad joined Twitter in March 2017 as part of an aborted effort to win a third four-year term. Ironically, the social-media platform was banned under his watch in 2009, as it was seen as tool for anti-regime activists and, possibly, for Western espionage, but many prominent figures in that country post tweets, including its supreme leader, Ayatollah Ali Khamenei.

Ahmadinejad has frequently used the platform for weighty pronouncements such as denouncing structural inequities in government policies, particularly those of the United States, and he has taken more than a few shots at President Trump. In August, he chided Trump over the latter’s tweet mocking LeBron James and CNN anchor Don Lemon. Ahmadinejad said at the time that he had “love” for James and another NBA superstar, Michael Jordan.

On Tuesday, Ahmadinejad was clearly in more of a mood to interact with other, less famous users. To one who showed him photos of tote bags she made with the names of several Iranian cities on them, he replied, “Nice work!”

It remains to be seen if Michigan Coach Jim Harbaugh fields questions about Ahmadinejad’s comment. Here’s one: Was the former Iranian president perhaps implying that the Wolverines don’t currently have enough of a “hard work ethic,” and if so, how do you respond?

As for Zimmerman, he was “thrilled” that, having posted his tweet shortly after the Wolverines were defeated by Notre Dame in their season opener, the team has righted the ship with five straight wins, rendering “obsolete” his “glum perspective.” Of course, dates with the Wolverines' two biggest traditional rivals are still yet to come, and with Harbaugh struggling in the past to beat those schools, Zimmerman said his take on the season has been, “Wake me when they beat Michigan State and Ohio State in the same season.”

That remains to be seen, but in the meantime, the longtime U of M fan would hardly have been blamed for wondering if he was dreaming, when he checked his Twitter feed on Tuesday.

Read more from The Post:

Nick Bosa leaves Ohio State to focus on the NFL draft and injury rehab

Mary Bono steps down after five days as USA Gymnastics’ interim CEO

What happens to Seahawks, Trail Blazers following owner Paul Allen’s death?

Alex Smith has one crucial advantage over Kirk Cousins. Don’t ignore it.