TEHRAN — All her life Yalda Moayeri, a 37-year-old photojournalist from Iran, has struggled with men. She has dealt with mansplaining colleagues, Iranian censors and the country’s security forces. Some created obstacles, others pressured her. She always fought back.

Now she’s tangling with President Trump, who used a photograph she shot without permission for his own political purposes.

On the 40th anniversary of the Islamic Revolution, celebrated on Monday, Mr. Trump tweeted an iconic image taken by Ms. Moayeri. The image — taken under dangerous circumstances — shows an unidentified protester in Tehran, her left fist raised while surrounded by smoke, during demonstrations in 2017.

Mr. Trump took aim at Iran’s leaders, who he, Secretary of State Mike Pompeo and National Security Adviser John R. Bolton all indirectly say must be changed.

A stone hit her leg and some police officers blasted fire extinguishers, filling the air with billowy white fumes that resembled tear-gas smoke, she recalled, as the protests spilled outside the university’s gates.

“Suddenly this young woman appeared through the smoke, covering her face with her head scarf and flashing a victory sign, I snapped some images,” she said. “I never figured out who she was. Only when I came home I saw the picture had power.”

Thousands were arrested, 25 people died, the authorities tried to control the news and Ms. Moayeri possessed an image that had captured it all. As a freelancer who had worked in Sudan, Somalia, Pakistan, Iraq and elsewhere, she had many places to sell the picture, but also knew that if her name were published she might get into trouble with the authorities.

She ended up selling the image to Iran-based photographers for The Associated Press and Agence France-Presse. It quickly spread via social media as the symbol of the protests in Iran. There was no contract, and Ms. Moayeri said she still owned the rights to the image.

After six months she decided she had waited long enough to take public credit for the image. Ms. Moayeri sent it to the annual Iranian Photojournalists Association and won first prize. She did not get in trouble.

She provided The New York Times with the sequence and original pictures taken that day.

“Taking pictures that tell the truth is the job of all photojournalists,” she said.

When Mr. Pompeo used the image last July ahead of a meeting with Iranians living in the United States who oppose the Islamic republic and its leaders, Ms. Moayeri said she had been upset, “but thought, ‘O.K., whatever.’”