NEW YORK — To avoid the pitfalls of politics, Anthony Scaramucci, the talkative Wall Street financier picked by President Trump Friday to lead his communications strategy, often advises those close to him to have thick skin.

It is a lesson he learned years ago from Trump. The two were seated at the same table during a Lupus Foundation luncheon and a dispirited Scaramucci told Trump that he was being “ripped apart” by the media.

“Look, it comes with the territory. You are gaining a high profile, which means it’s time for people to start shooting at you,” Trump told him, according to Scaramucci’s 2016 book “Hopping Over the Rabbit Hole.”

“Big deal you were raked over the coals a little bit,” Trump continued. “So what? It has been happening to me for over 30 years.”

Trump’s decision to bring Scaramucci into a top White House role represents a remarkable political ascension for the investment veteran, who had bounced around several Republican campaigns before striking gold as a full-throated Trump supporter.

Scaramucci, known as “The Mooch,” is in many ways cut from the same cloth as his new boss. Investors, associates and those who have worked with him say he is a brash New Yorker who is comfortable jousting with the media and a relentless promoter who doesn’t mind throwing sharp elbows.

Scaramucci said he would report directly to Trump as he takes charge of crafting the adminstration’s communications strategy and messaging. The new press secretary, Sarah Huckabee Sanders, will report to him.

Scaramucci is at least the third person offered the White House communications director job since Trump was elected last year. He arrives just as the White House prepares to shift its attention to two of Trump’s chief priorities, tax reform and economic growth.

During his first visit to the White House press room Friday, he displayed both his effusive affection for Trump, whom he said he “loved” several times, and his nearly 30 years of Wall Street experience as he bandied about financial jargon like “arbitrage” and “opportunity costs.”

Trump has long admired Scaramucci’s unabashed willingness to stick up for the president during hostile interviews on cable news. He has an upbeat enthusiasm that White House officials believe has been missing from their current communications strategy, several administration officials said.

His stature in the White House grew after CNN was forced to retract a story alleging that the Senate Intelligence Committee was looking into whether Scaramucci met with a top executive from a Russian investment fund before the inauguration. The moment was seen as a big victory for Trump and his allies, who have complained for months about negative media coverage. Scaramucci accepted CNN’s apology.

Scaramucci didn’t initially jump onto the Trump campaign and joins other top administration officials, including National Economic Council Director Gary Cohn and Treasury Secretary Steven Mnuchin, with a history of financial support for Democrats. He gave thousands of dollars to then-presidential candidate Barack Obama in 2008. And in a 2012 Twitter post, Scaramucci appeared to call for gun control measures, writing “We (the USA) has 5% of the world’s population but 50% of the world’s guns. Enough is enough. It is just common sense it apply more controls.”

In 2015, he worked on Scott Walker’s presidential campaign, serving as national finance chairman, and then he switched to the Jeb Bush campaign when Walker withdrew. Before he joined Trump’s campaign, he said during a 2015 Fox Business appearance that Trump was “another hack politician.”

During the press briefing Friday, Scaramucci apologized for calling Trump a “hack” and said the president still reminds him of the incident.

Scaramucci, like Trump, has deep New York roots. He started his career at Goldman Sachs being hired, fired, and rehired in a single year before leaving to start his own investment company. In 2005, he started SkyBridge Capital, which takes money from wealthy investors and parcels it out to hedge funds.

On Wall Street, he is known both for relentless salesmanship of both himself and his causes. Some employees recall that he could be abrasive in the office and that he was obsessed with Superman, filling his office with tchotchkes and an expensive painting of the super hero.

In January, Scaramucci announced he would sell his stake in SkyBridge Capital in anticipation of landing a job in the White House. It is unclear whether the sale to Chinese billionaire Chen Feng’s HNA Group and RON Transatlantic EG has been completed.When Scaramucci didn’t initially snag a White House job, he returned to his Wall Street roots, running an annual hedge fund conference in Las Vegas, called SALT

The schmooze-fest in the desert, which Scaramucci started in 2009, has helped raise his profile in political and Wall Street circles. Bush and former Vice President Joe Biden appeared this year along with hedge fund giants Daniel S. Loeb and Bill Ackman, both of whom Scaramucci has known for years.

He also has deep media connections. He hosted “Wall Street Week” and has served as a contributor to Fox News Channel.