WASHINGTON — President Trump said on Saturday that he would no longer hold next year’s Group of 7 meeting at his luxury golf club near Miami, a swift reversal after two days of intense criticism over awarding his family company a major diplomatic event.

“I thought I was doing something very good for our country by using Trump National Doral, in Miami, for hosting the G-7 leaders,” Mr. Trump wrote on Twitter, before again promoting the resort’s amenities. “But, as usual, the hostile media & Democrat partners went CRAZY!”

Mr. Trump added: “Therefore, based on both Media & Democrat Crazed and Irrational Hostility, we will no longer consider Trump National Doral, Miami, as the Host Site for the G-7 in 2020.”

The decision to host the Group of 7 at Mr. Trump’s club was first announced by Mick Mulvaney, the president’s acting chief of staff, during a news briefing on Thursday at the White House, but Mr. Trump had hinted that the resort would be a possibility for months. Democrats immediately portrayed the plan as a blatant act of self-dealing corruption, and ethics lawyers said payments from the visiting delegations could violate the emoluments clause of the Constitution, which forbids the president from accepting gifts and funding from foreign governments.