TEHRAN — Iranian lawmakers voted overwhelmingly on Sunday to increase the country’s budget for its ballistic missile program and foreign operations by the Revolutionary Guards, a direct challenge to new United States sanctions against the Islamic republic.

Some lawmakers shouted “Death to America” after the outlines of the bill “to counter America’s terrorist and adventurist actions” were passed by an overwhelming number of votes in Parliament, state television reported.

The increase in the military budget and other measures came in retaliation to legislation passed by Congress and reluctantly signed by President Trump this month to impose new sanctions on Iran over its missile program.

Mr. Trump has repeatedly threatened to leave the nuclear agreement, which was struck by the United States, Iran and other world powers in 2016. That has led to rising frustration in Iran, where the agreement was hailed by ordinary citizens as a fresh start after years of sanctions. It was also seen as a counterweight to hard-line forces in the country.

The Parliament bill obliged the new government of President Hassan Rouhani to prepare a strategic plan for confronting the “threats, malicious, hegemonic and divisive activities of America in the region.” It also seeks to impose sanctions on the entire United States administration and all Central Intelligence Agency personnel.

Mr. Rouhani has been seeking an easing of tensions with the United States since his first term. The bill proposed by Parliament needs the approval of an oversight watchdog, but that seems like a technicality, experts say.

Iran’s total military budget increase is less than $800 million, a fraction of the cost of the latest arms purchase by Saudi Arabia, Iran’s regional nemesis, from American defense companies. The Saudis ordered $110 billion worth of United States arms in May.

Iran will spend $260 million on its ballistic missile program and around $300 million on activities by the Quds brigade, the international arm of the Revolutionary Guards corps. The rest of the money will go to other military and intelligence projects, state media reported.

The Trump administration has been connecting Iran’s missile program to the nuclear agreement. A United Nations resolution calls for Iran not to undertake activity related to ballistic missiles designed to have a nuclear warhead. While the resolution does not prohibit such tests, Iran says it does not want to make nuclear warheads — something the International Atomic Energy Agency verified during continuing inspections.

Members of the Iranian establishment, even hard-liners who have criticized the agreement, say they want the agreement to stay in place. And they certainly do not want to be blamed for its failure, politicians say. Responding to the vote, the deputy foreign minister, Abbas Araqchi, told members of Parliament that the government backed the bill, which he said “was designed wisely” so that it did not violate the nuclear deal and “provide excuses for opposing sides,” the state news agency IRNA reported.

Iran’s armed forces, controlled by hard-liners, have been responding to American pressures with more, not fewer, missile tests — just as North Korea has.

The top commander of Iran’s Revolutionary Guards Corps, Maj. Gen. Mohammad Ali Jafari, accused the United States on Sunday of actively seeking to weaken Iran’s armed forces ever since the nuclear agreement was signed.

Speaking at a ceremony for an Iranian soldier executed by the Islamic State in Syria, Mr. Jafari said that enemies had recently been “seeking to undermine these capabilities, and since the deal, they have been imposing defensive and missile sanctions to weaken the country’s armed forces.”

A version of this article appears in print on , on Page A8 of the New York edition with the headline: Defying U.S., Iran Votes To Raise Military Spending. Order Reprints | Today’s Paper | Subscribe