Brazilian President Jair Bolsonaro speaks during a ceremony on April 30 at the Planalto Palace in Brasilia. (Adriano Machado/Reuters)

It started with the venue.

The American Museum of Natural History in New York agreed to be the site of a gala put on by the Brazilian-American Chamber of Commerce, scheduled for May 14.

Then it was learned whom the chamber planned to name its person of the year at the event: Brazilian President Jair Bolsonaro, a far-right populist who has pushed for controversial economic development in the Amazon and once said he would prefer his son to be dead rather than gay.

Suddenly, the museum was at the center of an international controversy, eager to distance itself from the event’s honoree.

On Apr. 11, the museum tweeted that the event had been booked “before the honoree was secured.”

“We are deeply concerned, and we are exploring our options,” the tweet said. Four days later, the museum announced the gala would no longer take place there, saying that the chamber and the museum agreed it was “not the optimal location.”

Now, weeks after the museum backed away from the event, Bolsonaro announced he is no longer coming to New York at all.

A spokesman for the presidency said on Friday that Bolsonaro canceled the trip when “faced with resistance and deliberate attacks from the mayor of New York and the pressure of interest groups on the institutions that organize, sponsor and host the event annually.”

Last month, New York Mayor Bill de Blasio tweeted that Bolsonaro is “a dangerous man” and thanked the museum for canceling the event.

His “overt racism, homophobia and destructive decisions will have a devastating impact on the future of our planet,” de Blasio wrote.

After the museum balked, the gala changed venues, booking the Marriott Marquis in Midtown Manhattan. The honorees also included Secretary of State Mike Pompeo, named the American recipient of the same person of the year award.

Despite the location change, the controversy lingered. And this past week, a number of high-profile sponsors pulled out of the event, including Delta Air Lines, the Financial Times, and Bain & Co. By Friday, Bolsonaro’s team said he would cancel his plans to attend the gala.

The mayor certainly scored it as a win.

“Jair Bolsonaro just learned the hard way that New Yorkers don’t turn a blind eye to oppression,” de Blasio tweeted on Saturday. “We called his bigotry out. He ran away. Not surprised — bullies usually can’t take a punch.”

The chamber did not immediately return a phone call but its website said the event will take place as scheduled. Kathleen Duffy, a spokesperson for Marriott’s hotels in New York, told The Post that the event was still scheduled for May 14. As The Post previously reported, Marriott’s chief executive, Arne Sorenson, wrote in a blog post this week, “Allowing a group to use our facilities in no way suggests we endorse its views."

“It just means we are trying to live up to our ideals of openness and inclusivity, understanding that we may put ourselves in an uncomfortable position,” he wrote.

Bolsonaro, a former army captain, ran on a firmly nationalist platform and won with around 55 percent of the vote in October. When he visited Washington in March, President Trump said he was “honored” that Bolsonaro’s campaign drew comparisons to his own. Bolsonaro said he and Trump “have a great deal of shared values."

“I admire President Donald Trump,” he said at the time. Then the two leaders exchanged gifts, each one receiving a soccer jersey with their names on the back.

It’s fair to say that Bolsonaro probably wouldn’t have been received quite as warmly farther up the East Coast. “Good riddance,” de Blasio wrote on Twitter after the Brazilian leader canceled his trip. “Your hatred isn’t welcome here.”

Marina Lopes contributed to this report.

Read more:

Activists feared Brazil’s Bolsonaro would accelerate Amazon deforestation. Now they think it’s already happening.

In Brazil, a rare school shooting fuels a familiar debate over guns

A mining disaster covered a town in toxic sludge. Now, residents navigate a wasteland.