BAGHDAD — Hadi al-Ameri, the chief of one of Iraq’s most powerful paramilitary groups, has been crisscrossing the country ahead of national elections on Saturday. At one campaign rally after another, he has been headlining a ticket stocked mostly with men like himself: soldiers who are vying to be the next class of Iraqi statesmen.

On the stump, he constantly resists the view widely held in Baghdad and Washington that he is Iran’s man in Iraq — Tehran’s best hope for cementing its influence in a country where it invested heavily in expelling the Islamic State.

But in fact, for more than three decades, Ameri has fought for and most recently commanded a militia armed and trained by Iran that has been crucial in extending Iranian influence in Iraq.

Ameri and his election coalition, called Fatah, or Conquest, could present the main challenge to Prime Minister Haider al-Abadi, who has eschewed the traditional rhetoric of sectarianism and Shiite supremacy for a more inclusive Iraqi nationalism. 

While Abadi has tried as prime minister to steer a course between U.S. and Iranian interests, he is the favored candidate of U.S. officials, and the election is widely seen by many Iraqi politicians and analysts as a contest pitting the United States’ incumbent against Iran’s challenger.

In overseeing the battle last year to oust the Islamic State from Iraqi territory, Abadi relied heavily on American air power and ground forces, while Ameri has commanded forces armed and trained by Iran’s Islamic Revolutionary Guard Corps. Ameri’s Badr Organization was founded in Tehran in the 1980s to fight against then-Iraqi President Saddam Hussein.

How the competing tickets fare at the polls will have a broad impact on how the country deals with its main allies, Iran and the United States, as tensions between the two powers escalate.

Trump’s announcement this week that he is pulling the United States out of the Iran nuclear deal has raised concerns here that the rivalry between Washington and Tehran will play out in Iraq, destroying what has been four years of nominal cooperation in the fight against the Islamic State.

The two countries have kept an unusually low profile in Iraq’s parliamentary elections, refraining from public statements in support of any candidate. Analysts say the U.S. decision to withdraw from the nuclear deal could push Iran to be more assertive.

“Iran will fight fiercely to control everything in Iraq, markets, economy, oil,” said Ghalib al-Shahbandar, a political analyst and former Iraqi politician. “If worst comes to worst, they already have military wings who are running in the elections.”

Ameri and others in his election coalition do not deny that they have strong ties to Iran, but they bristle at the notion that they are agents of Tehran. They have shed their military fatigues for business suits and adopted Abadi’s centrist rhetoric of a strong and unified Iraq that takes no sides in regional conflicts.

During a recent interview at his well-appointed and heavily guarded house in Baghdad’s fortified Green Zone, Ameri was clearly exhausted from campaigning and barely able to keep his eyes open. But they opened wide at the mention of Iran, and he leaned forward in his chair.

“Iran is broke,” he said with a smile, suggesting that it did not have enough spare cash to underwrite his campaign. He denied that Iran has been funding his election coalition. 

Ameri’s coalition has run on a platform of fighting corruption, diversifying Iraq’s oil-dependent economy and nourishing the country’s private sector. The candidates on his ticket uniformly oppose the presence of U.S. forces in Iraq and have said Abadi is too closely aligned with Washington.

But most of all, they have touted their battlefield victories against the Islamic State and insisted that the paramilitary group that underpins their influence remain a semiautonomous part of Iraq’s security forces. That group, an umbrella for dozens of militias, musters nearly 150,000 fighters.

Ameri’s forces are part of that group, what is called al-Hashd al-Shaabi, or the Popular Mobilization Units. The militias in the group were deputized by the government to counter the Islamic State as it overran nearly one-third of Iraq in 2014. Many of these militias are backed by Iran and fought fiercely against American troops after the U.S. invasion of Iraq in 2003. 

The militias now have legal status in Iraq and ostensibly are under the command of the prime minister. A representative of the militias sits on Iraq’s National Security Council and is not answerable to the Defense Ministry or the Interior Ministry.

Contrary to Abadi’s stated policy of not interfering in regional conflicts, some of the militias have sent fighters to Syria who are in combat alongside Iranian and Syrian forces in support of President Bashar al-Assad.

U.S. officials have pushed Abadi to shrink the PMU paramilitary groups and subordinate them to Iraq’s police and army. But the prime minister has been reluctant to challenge the militia ­leaders, who are popular because of their role in defeating the Islamic State.

Ameri is perhaps the most influential of those leaders. In recent weeks, his face has been ubiquitous on election posters plastering Iraq’s streets. He has positioned himself as the alternative to Abadi — projecting the image of a decisive, battle-hardened field commander who will eradicate terrorism while elevating Iraq’s international prestige.

As a result, the elections are in part also a test of Iraqis’ appetite for a government with a decidedly military character over a civilian-led one.

Ameri says that building a strong state would defeat what he calls “the Triangle of Death” that has bedeviled Iraq: terrorism, sectarianism and corruption.

“We want to head the government, not for the power but to serve the people of Iraq,” he said during the interview. “If this coming government doesn’t succeed in providing services, the people will revolt. They’re fed up. We believe we can prevent this situation — just like we did on the front lines.”

His coalition has made little effort to uncouple its political and military identities, and that has earned it a scolding from Iraq’s most influential Shiite cleric, Grand Ayatollah Ali Sistani. Speaking through a representative at a recent Friday prayer sermon, Sistani criticized candidates who exploit their security achievements to score political points and stated bluntly that he opposes foreign money and support going to Iraqi candidates.

Although he did not name Ameri’s Fatah coalition, the reprimand was largely seen as being directed at it. 

Ahmed al-Assadi, a member of parliament running on Ameri’s ticket, brushed aside Sistani’s comments, saying they were aimed at all candidates who have sought to exploit patriotism after the defeat of the Islamic State.  

Assadi, the top spokesman for the PMU during the fight with the Islamic State, said his ticket has credibility with Iraq’s voters that cannot be matched by others. “We are close to the people,” he said. “There’s been a sowing of trust between us. We don’t sit in palaces and talk. We are in the streets with the people, listening to them.”

Assadi predicts that the ticket will win enough seats to gain a strong negotiating position in the complex and lengthy process of forming a government.

“Ameri is a very strong candidate, there is no doubt,” said a senior U.S. official. “But I think he’s a bit more of a one-dimensional candidate.”

The official said that Ameri’s popularity may actually represent a weakening of Iran’s influence in Iraq. With the Shiite vote likely to split this year among Abadi, Ameri and former prime minister Nouri al-Maliki, a unified, pro-Iranian Shiite government is less likely to emerge now than at any time since elections were first held in 2005.

“The goal of Iran since the first set of elections has been to have a solid, unified Shiite majority to run the country,” said the official, who spoke on the condition of anonymity to discuss internal Iraqi politics. “They’re getting further from achieving this goal.”

The figures associated with the militias are not new to politics. Ameri’s Badr Organization holds 22 seats in Iraq’s current parliament, and the current and previous interior ministers are members of the group. Other pro-
Iranian militias have two seats in Iraq’s legislature.

Sajad Jiyad, director of the al-Bayan Center, a think tank in Baghdad, said Ameri’s ticket is positioning itself to expand its presence in parliament but is unlikely be strong enough to form the next government.

“Realistically, their aim is just to make sure that they have a say in government,” Jiyad said. “Iran’s tie-in to that is that they have an outlet for their influence and they have representation for their interests in the Iraqi state.”

Ameri said his Fatah coalition’s credentials as a “purely Iraqi movement” have been proved “with our blood.”

“We never left. We didn’t run like some others,” he said, referring to the U.S.-trained government forces that collapsed in the face of the Islamic State blitz in 2014. “We stayed on the battlefields.”