BAGHDAD — Lockheed Martin said Monday that it was withdrawing its maintenance teams for Iraq’s F-16 fighter jets for security reasons, as the Iraqi government struggles to end rocket attacks by militias suspected of being backed by Iran.

The departure by the U.S. weapons manufacturer from Balad air base, 40 miles north of Baghdad, highlights the Iraqi government’s inability to rein in the militias, which are thought to be behind attacks on U.S. interests. It comes a year after the Iraqi prime minister, Mustafa al-Kadhimi, took power pledging to reduce Iranian influence in the country.

The decision by Lockheed Martin is expected to ground the few remaining F-16s from Iraq’s fleet that were still operational. That is casting doubt on Iraq’s ability to fight Islamic State militants without substantial U.S. help, at a time when Mr. al-Kadhimi is under pressure to negotiate a withdrawal of all U.S. forces.

“In coordination with the U.S. government and with employee safety as our top priority, Lockheed Martin is relocating our Iraq-based F-16 team,” Joseph LaMarca Jr., a company vice president for communications, said in a statement.

Advertise with us

Mr. LaMarca declined to say how many employees were being withdrawn, and another company spokesperson said Lockheed Martin would not disclose any further information.

Iraq’s Defense Ministry did not comment, but an Iraqi security official, who declined to be identified because he was not authorized to speak publicly, said that Lockheed Martin had 70 employees at Balad. He added that 50 would be relocated to the United States while about 20 would be moved to Irbil in the semiautonomous Kurdistan region of Iraq.

A senior ministry official, who asked not to be identified so as to speak openly, confirmed that Lockheed Martin was withdrawing the team because of repeated rocket attacks on the base. He said that efforts to persuade the company to stay had failed.

“We asked them to delay the decision,” the official said. “They told us, ‘We will leave for two or three months, and when you provide protection, we will return to Iraq.’”

“Unfortunately, the departure will affect the operation of the F-16s,” he said.

This article originally appeared in The New York Times.