Trump and Saudi King Salman accused Iran of spreading "terrorism" during a gathering of leaders from 50 Muslim-majority countries.
Iranian Foreign Minister Mohammad Javad Zarif on Sunday criticised US President Donald Trump for sealing an arms deal and other investments worth hundreds of billions of dollars with Saudi Arabia.
Zarif's comments came after Trump, who was on a two-day visit to Saudi Arabia, urged Arab and Islamic leaders to unite and defeat extremists and "isolate" Iran.
"Iran - fresh from real elections - attacked by @POTUS in that bastion of democracy & moderation. Foreign Policy or simply milking KSA of $480B?," Zarif wrote in a Twitter post, referring to the Kingdom of Saudi Arabia.
Predominantly-Shia Iran and the predominantly-Sunni kingdom, Saudi Arabia, accuse each other of backing different sides in the conflicts in Iraq, Syria and Yemen.
"Just a show"
Separately, Iran's newly re-elected President Hassan Rouhani on Monday dismissed Trump's summit with Arab leaders as "just a show".
"The gathering in Saudi Arabia was just a show with no practical or political value of any kind," Rouhani said.
"You can't solve terrorism just by giving your people's money to a superpower," he said in a jibe at the billion-dollar deals signed between Trump and the Saudi government.
On Sunday, Trump, visiting Saudi Arabia at the start of his first foreign tour since taking office, singled out Iran as a key sponsor of militant groups, a day after Rouhani won a second term as Iran's president.
"The government that gives terrorists safe harbour, financial backing... The regime that is responsible for so much instability in that region. I am speaking of course of Iran," Trump said.
"Until the Iranian regime is willing to be a partner for peace, all nations of conscience must work together to isolate it."
We derive stability not from "coalitions", but from our people, who -unlike many- do vote. Iranians must be respected & are ready to engage.— Javad Zarif (@JZarif) May 20, 2017
Trump's words aligned with the views of his Saudi Arabian hosts.
Introducing Trump, Saudi King Salman bin Abdulaziz Al Saud described Tehran as a mutual foe and a "source of terrorism" they must confront together.
Trump's Riyadh visit kicked off his first presidential trip abroad, with Saudi Arabia the first stop on a nine-day journey through the Middle East and Europe.