The financier Tom Barrack told the 2016 Republican National Convention that Donald J. Trump “played me like a Steinway piano” in the 1988 deal that began their friendship.

The billionaire financier Tom Barrack was caught in a bind.

In April 2016, his close friend Donald J. Trump was about to clinch the Republican presidential nomination. But Mr. Trump’s outspoken hostility to Muslims — epitomized by his call for a ban on Muslim immigrants — was offending the Persian Gulf princes Mr. Barrack had depended on for decades as investors and buyers.

“Confusion about your friend Donald Trump is VERY high,” Ambassador Yousef al-Otaiba of the United Arab Emirates emailed back when Mr. Barrack tried to introduce the candidate, in a message not previously reported. Mr. Trump’s image, the ambassador warned, “has many people extremely worried.”

Not deterred, Mr. Barrack, a longtime friend who had done business with the ambassador, assured him that Mr. Trump understood the Persian Gulf perspective. “He also has joint ventures in the U.A.E.!” Mr. Barrack wrote in an email on April 26.

The emails were the beginning of Mr. Trump’s improbable transformation from a candidate who campaigned against Muslims to a president celebrated in the royal courts of Riyadh and Abu Dhabi as perhaps the best friend in the White House that their rulers have ever had. It is a shift that testifies not only to Mr. Trump’s special flexibility, but also to Mr. Barrack’s unique place in the Trump world, at once a fellow tycoon and a flattering courtier, a confidant and a power broker.

During the Trump campaign, Mr. Barrack was a top fund-raiser and trusted gatekeeper who opened communications with the Emiratis and Saudis, recommended that the candidate bring on Paul Manafort as campaign manager — and then tried to arrange a secret meeting between Mr. Manafort and the crown prince of Saudi Arabia. Mr. Barrack was later named chairman of Mr. Trump’s inaugural committee.

But Mr. Manafort has since been indicted by the special prosecutor investigating Russian meddling in the presidential election. The same inquiry is examining whether the Emiratis and Saudis helped sway the election in Mr. Trump’s favor — potentially in coordination with the Russians, according to people familiar with the matter. Investigators have also asked witnesses about specific contributions and expenses related to the inauguration, according to people familiar with those interviews.

Mr. Trump in Riyadh, Saudi Arabia, in 2017, for an Arab summit meeting. “It all started with you and JK and I,” Mr. Barrack wrote in a congratulatory email to the Emirati ambassador about the meeting; the initials refer to Jared Kushner.

A spokesman for Mr. Barrack said he has been advised he is not a target of the special prosecutor. Investigators interviewed him in December but asked questions almost exclusively about Mr. Manafort and his associate Rick Gates, said a person familiar with the questioning.

Mr. Barrack has steered clear of any formal role in the administration; he has said he rebuffed offers to become treasury secretary or ambassador to Mexico. (He sought a role as a special envoy for Middle East economic development, but the idea never gained traction in the White House.)

Instead, he has continued making money, as he has for decades, working with the same Persian Gulf contacts he introduced two years ago to Mr. Trump. Mr. Barrack’s company, known as Colony NorthStar since a merger last year, has raised more than $7 billion in investments since Mr. Trump won the nomination, and 24 percent of that money has come from the Persian Gulf — all from either the U.A.E. or Saudi Arabia, according to an executive familiar with the figures. Colony NorthStar has not disclosed the investors in its funds.

Mr. Barrack’s email correspondence with Ambassador Otaiba, which has not previously been reported, was provided to The New York Times by an anonymous group critical of Emirati foreign policy, and it illustrates the formative role Mr. Barrack played as a matchmaker between Mr. Trump and the Persian Gulf princes.

Mr. Barrack’s representatives did not dispute the authenticity of the emails. His spokesman said in a statement that Mr. Barrack “sees his business in the Middle East as a way to help political dialogue and understanding, not the other way around, and he does so through relationships that span as far back as the reign of even some of the grandfathers of the current regional rulers.”

But having the ear of the president, say other executives and former diplomats who work in the Gulf, has only enhanced Mr. Barrack’s stature in the region.

“He is the only person I know who the president speaks to as a peer,” said Roger Stone, a veteran Republican operative who has known both men for decades. “Barrack is to Trump as Bebe Rebozo was to Nixon, which is the best friend,” Mr. Stone added, referring to the wealthy real-estate developer who is best remembered for his closeness to President Richard Nixon during his impeachment process.

Mr. Barrack’s closeness to Mr. Trump extends to the president’s family. By 2010, he had acquired $70 million of the debt owed by Mr. Trump’s son-in-law, Jared Kushner, on his troubled $1.8 billion purchase of a skyscraper at 666 Fifth Avenue in New York. After a call from Mr. Trump, Mr. Barrack was among a group of lenders who agreed to reduce Mr. Kushner’s obligations to keep him out of bankruptcy.

A month after his first outreach to Ambassador Otaiba, Mr. Barrack wrote again on May 26 to introduce Mr. Kushner, who was preparing for a role as a presidential envoy to the Middle East.

A Billionaire Buddy

Thomas J. Barrack Jr. and Donald J. Trump first met in the 1980s, and Mr. Barrack got the better of the encounters. He negotiated Mr. Trump into overpaying for two famous assets: a one-fifth stake in the New York department store chain Alexander’s in 1985, and the entire Plaza Hotel in 1988. Mr. Trump paid about $410 million for the Plaza and later lost both properties to creditors.

But Mr. Barrack nonetheless parlayed the deals into a lasting friendship, in part by flattering Mr. Trump about his skill as a negotiator.

“He played me like a Steinway piano,” Mr. Barrack recounted in a speech at the Republican convention.

At 71, Mr. Barrack is the same age as President Trump and shares his fondness for expensive trophies. He owns a 700-acre winery and polo ranch in the Santa Ynez Valley in California, sold a seven-bedroom mansion in Santa Monica last year for $38 million, and snapped up an Aspen ski resort for a reported $18 million just in time for the start of the season.

Yet people who know him well say he still tells new acquaintances that he is truly honored to meet them, cheerfully doling out superlatives like “first-class,” “amazing” and “brilliant.” He invariably tells the story of his own success as a parable about luck and perseverance, never about talent.

He grew up speaking Arabic as…