Trump, who has frequently engaged in inflammatory anti-Muslim rhetoric, hosted the event in the State Dining Room.
He did not hold a similar event in his first year in office, in a break with past presidents.
Millions of devout Muslims observe the holy fasting month of Ramadan, which is slated to end on June 14 this year.
From sunrise onwards, they abstain from food and drink, breaking their fast at sunset.
Happening Now: President Trump hosts Iftar at the White House. The 52 attendees are mostly administration officials and foreign ambassadors. (Random observation: How many individuals do you think actually fasted today?) pic.twitter.com/n32qoPzxNh
— Jake Turx (@JakeTurx) June 7, 2018
There were more than 50 guests. At the head table, Trump sat with Saudi Ambassador Prince Khalid Ben Salman, and Jordanian Ambassador Dina Kawar.
Ambassadors were invited from the United Arab Emirates, Jordan, Egypt, Tunisia, Iraq, Saudi Arabia, Qatar, Bahrain, Morocco, Algeria and Libya.
“To each of you and to the Muslims around the world: Ramadan Mubarak,” Trump said.
“Tonight, we give thanks for the renewed bonds of friendship and cooperation we have forged with our valued partners from all across the Middle East,” he said.
Iftar dinners have been a regular feature on the White House calendar, along with prayer breakfasts, Passover Seders and similar events.
Several American Muslim groups said they would not participate in Wednesday’s iftar.