BEIRUT — Lebanese authorities banned the new “Wonder Woman” movie Wednesday hours before it was due to premiere in the capital and following a campaign against its lead actress, Gal Gadot, who served in the Israeli army, a security official and activists said.

Cinemas in Beirut began removing the movie posters and cinema executives said the movie will not be shown because of the ban.

Lebanon is officially at war with Israel and the two countries have been through a number of wars. A particularly devastating 2006 war battered Lebanon’s infrastructure and left hundreds of civilians killed.

The ban is in accordance with a decades-old law that boycotts Israeli products and bars Lebanese citizens from traveling to Israel or having contacts with Israelis. The official says the ban issued by the minister of interior Wednesday has been relayed to the distribution company, which in turn have to inform the theaters planning to show the movie.

A premiere later Wednesday in Beirut was cancelled. An executive at the Grand Cinema chain said the company was planning to show the movie in 16 out of its 18 theaters around the country, but it would now be removed.

The security official said violators of the ban will have to face legal consequences, but he didn’t specify. He spoke on condition of anonymity because the decision has not yet been published.

A campaigner against the movie, Rania Masri, hailed the decision to ban “Wonder Woman,” saying it signaled respect for the law. She said there was much anticipation as the decision was last minute, just before the official launch of the movie.

“Still, it was a joyous moment the minute the law was implemented,” Masri, of the Campaign to Boycott Supporters of Israel – Lebanon told The Associated Press.

A similar campaign against another movie where Gadot played the role of Wonder Woman last year, “Batman v Superman,” never turned into an outright ban. Masri said it was “different” this time because of a major media campaign against the movie that has helped push for the ban.

On its front page Wednesday, the leading al-Akhbar newspaper had a column titled: “The Israeli soldier. She has no place in Lebanon.” The column featured a picture of Gadot carrying her Wonder Woman shield.

Warner Bros., which has released the film, declined comment.

Economy Ministry official Alia Abbas told the AP that her department, which is responsible for enforcing the boycott of Israel, had delivered a request to ban “Batman v Superman” last year. But the ban didn’t come together. This time they presented their petition to the security agencies on Monday, she said.

Tensions have been rising between Israel and Hezbollah, with Israel reportedly bombing several Hezbollah targets in Syria in recent months. Israel has signaled that the targets were smuggling sophisticated weapons to Lebanon. Hezbollah officials said recently that they are not seeking war but are ready for it.

On her Facebook page, Gadot had praised Israel’s military during the 2014 Gaza-Israel war, sending prayers to soldiers “who are risking their lives protecting my country against the horrific acts conducted by Hamas.”

Masri said the campaign to boycott is about “self-respect” and “resisting” normalizing relations with a state that is at war with Lebanon and occupies Palestinian land. “First and foremost she is Israeli. We don’t distinguish between a good Israeli and a bad Israeli,” Masri said of the boycott campaign.

The movie, based on the DC Comics character, has earned acclaim for Gadot for landing a rare leading role for a woman in a super hero movie.

Even though Lebanon enjoys a greater margin of freedom of expression than other countries in the region, prior censorship remains in place, particularly with content relating to Israel, religion and homosexuality.

Some in Lebanon criticized the call for the ban, but their voices were faint compared to the boycott campaign that featured in primetime television in Lebanon.

“We sold many tickets and we had to cancel now,” said Isaac Fahed, sales and distribution manager for Grand Cinemas, the company which had the movie scheduled for 16 of its 18 movie houses. He said his company would abide by the law, despite the losses it would suffer. “We have to respect that, but we have few questions.”

Fahed said previous movies with Gadot were shown in Lebanese theaters and her new film will be viewed online and sold on DVD.

“The end result will only … affect the cinemas,” Fahed said.

SARAH EL DEEB, Associated Press; Associated Press writers Andrea Rosa in Beirut and Jake Coyle in New York City contributed to this report.