ISTANBUL — A top Iranian general warned the United States on Thursday against "dangerous behavior" in the Persian Gulf, saying his forces would target U.S. naval ships that posed a threat to Iran's national security.

“We are determined to defend our national security [and] maritime borders,” Maj. Gen. Hossein Salami, commander of Iran’s Islamic Revolutionary Guard Corps, said in an interview with Iranian state television. He added that any act by U.S. forces that endangers Iranian military or civilian ships “will be met with an immediate and decisive response.”

Salami made the remarks a day after President Trump said he had directed the U.S. Navy to “shoot down and destroy” Iranian gunboats that “harass” U.S. ships in the gulf.

The U.S. military said vessels belonging to the Revolutionary Guard came dangerously close to U.S. ships in the area last week.

Salami on Thursday blamed the incident on U.S. forces, accusing the American ships of “unprofessional and dangerous behavior.”

For decades, the Persian Gulf, where the United States maintains a significant military presence including the headquarters for the Navy’s 5th Fleet in Bahrain, has been the backdrop for military brushes and threats between Iran and the United States.

Iran has repeatedly warned that U.S. sanctions could prompt a retaliatory blockade of the Strait of Hormuz at the mouth of the Persian Gulf, the critical sea lane for oil tankers. Iranian fast boats also have come close to U.S. Navy vessels in the past, acts that the Pentagon has described as harassment, but no direct clashes have taken place.

But last year, the Revolutionary Guard said it downed a U.S. surveillance drone over the strait. Iranian forces also seized a British-flagged tanker last year in response to an Iranian tanker being held by the British territory of Gibraltar. Both vessels were later released.

The Revolutionary Guard directs all of Iran’s key military operations under the authority of the country’s supreme leader, Ayatollah Ali Khamenei. But the Guard’s influence has been further bolstered during the coronavirus crisis, which has claimed more than 5,000 lives in Iran according to the country’s official death toll. Many outside experts, however, say the real tally could be higher.

The Guard — and its domestic paramilitary Basij force — have built medical facilities and taken the lead in enforcing quarantine measures.

The Revolutionary Guard’s most prominent commander, Maj. Gen. Qasem Soleimani, was killed in a U.S. drone strike in January, and its ranks have been hit especially hard by the virus, which has sickened or killed numerous leaders and soldiers.

But the economic blows from the pandemic and international sanctions also have struck directly at the Guard.

The Guard has a hand in almost every level of Iran’s economy — including construction, automating, defense production and oil — and could be hit directly from a collapse in oil prices and wider global shocks from the pandemic. In October, the International Monetary Fund predicted the Iranian economy would shrink by more than 9 percent this year.

The Revolutionary Guard and its foreign operations wing, the Quds Force, have been forced to curtail or freeze some of their activities, including in Syria, where Iran-backed militias are helping President Bashar al-Assad reclaim the last rebel strongholds in that country’s civil war. Social media postings in recent weeks have depicted fighters being redeployed to factories to sew surgical masks and gowns.

Joby Warwick in Washington contributed to this report.