Iranian Foreign Minister Mohammad Javad Zarif criticized U.S. President Donald Trump and Saudi Arabia for their weapons and investment deals and suggested that the Arab country’s policies were to blame for the September 11 attacks in the United States.

The comments on May 21 came hours after the U.S. president singled out Iran as a key sponsor of Islamist militant groups in a speech during his visit to Saudi Arabia.

The remarks also came after reformist Iranian President Hassan Rohani was resoundingly reelected to a second term on May 19, a result some observers say could improve Tehran's relations with the West.

Zarif took to Twitter to denounce the Saudis' deals with the United States.

"Iran -- fresh from real elections - attacked by @POTUS in that bastion of democracy & moderation. Foreign Policy or simply milking KSA of $480B?" Zarif wrote. POTUS refers to the president of the United States and KSA to Saudi Arabia.

Shi'ite Muslim majority Iran and Sunni-led Saudi Arabia have long been bitter rivals in the region, with each accusing the other of attempting to undermine competing branches of Islam.

Critics of Saudi Arabia have said that its strict view of Islam fuels Sunni extremism, called takfir, and some accuse the Saudis of responsibility for the September 11, 2001, terror attacks in the United States. Fifteen of the 19 attackers were Saudi citizens.

The Saudis deny the allegations.

"[Trump] must enter into dialogue with them about ways to prevent terrorists and takfiris from continuing to fuel the fire in the region and repeating the likes of the September 11 incident by their sponsors in Western countries," Zarif wrote for the website of the London-based Al-Araby Al-Jadeed news network.

Separately, the deputy chief of staff of Iran's armed forces rejected U.S. Secretary of State Rex Tillerson's demand for Rohani to cease Tehran's ballistic-missile program and support for what he called its "network of terrorism."

Brigadier-General Masoud Jazayeri said Tillerson's remarks "reflected ignorance about Iran."

"Iran's defense policies and aims follow a set trend that cannot be affected by any element," Jazayeri said, according to the state news agency IRNA.

With reporting by AP, Reuters, IRNA, and AFP