NEW YORK — Former New York mayor Michael Bloomberg announced Tuesday that he would not run for president, concluding that his path to the Democratic nomination was narrow and that he could accomplish more as a private citizen.

The decision removes from the race one of the world’s richest men, a self-described centrist who had the potential to dominate early primary spending and complicate the campaigns of other moderate candidates.

“I believe I would defeat Donald Trump in a general election,” Bloomberg, 77, said in a statement posted online Tuesday afternoon. “But I am clear-eyed about the difficulty of winning the Democratic nomination in such a crowded field.”

In place of a candidacy, Bloomberg has committed to funding a new independent political operation with the goal of preventing the reelection of President Trump, with intensive voter targeting and outreach in swing states over the next 18 months.

The former mayor, who is worth more than $50 billion from his control of the financial services empire that shares his name, made the final decision Monday morning in New York, after a months-long process of building a campaign infrastructure. He had lined up staff, done extensive polling and scoped out Manhattan office space for a potential campaign headquarters.

Throughout the process, the prospect of a candidacy by former vice president Joe Biden, who has not yet announced his intentions, loomed large, as Bloomberg’s advisers concluded that he appealed to a similar set of primary voters.

The sentiments of Democratic Party voters toward someone with Bloomberg’s business background also threatened his primary path. Some more liberal candidates, including Sen. Elizabeth Warren (D-Mass.) and Sen. Bernie Sanders (I-Vt.), have made the enormous wealth of billionaires like Bloomberg a central theme of their campaigns.

Bloomberg would also have faced criticism for his record as a supporter of stop-and-frisk policing, his opposition to some Wall Street regulations promoted by President Barack Obama and his history of settling workplace sexual harassment claims.

Advisers said he ultimately decided not to run after concluding he could accomplish more through his political activism and philanthropic work over the next two years, and by focusing on such issues as gun violence, opioid addiction and climate change.

“I’ve come to realize that I’m less interested in talking than doing,” he wrote. “And I have concluded that, for now, the best way for me to help the country is by rolling up my sleeves and continuing to get work done.”

Bloomberg has drafted, with former Sierra Club executive director Carl Pope, a preliminary policy proposal for what he considers a more achievable climate change plan than the Green New Deal, the proposal promoted by Rep. Alexandria Ocasio-Cortez (D-N.Y.), which he believes cannot pass Congress. Bloomberg hopes Democrats ultimately adopt the plan with an eye toward enacting it into law after the 2020 election.

Sen. Edward J. Markey (D-Mass.), who has been working with Ocasio-Cortez on climate change policy, said Bloomberg would play a central role in the coming effort to reduce carbon emissions.

“Now that we have a destination, Mike Bloomberg will help us find the path to get there,” he said.

Pope said that Bloomberg intended to be “the person who writes the playbook.”

“We want this to be the platform on which presidential candidates who want to take action on climate will agree,” he said.

Bloomberg plans to increase his investment in a philanthropic effort called Beyond Coal, which has worked to shutter coal-fired power plants in recent years, and to launch a new effort called Beyond Carbon, with the goal of largely eliminating the use of gas, oil and coal in the United States by 2050.

Through grass-roots organizing and legal challenges, the Bloomberg-backed effort has helped close more than half of the coal-fired power plants in the country since 2010. He aims to force the closure of the remaining facilities by 2030.

To build the anti-Trump operation, Bloomberg’s team has recruited a number of former advisers to Obama’s 2012 reelection campaign.

After spending $115 million to elect Democrats in the 2018 midterms, Bloomberg could spend more on the 2020 effort, advisers said.

The effort will focus on coming up with a message strategy and communicating early with persuadable voters in expected swing states even before Democrats pick a nominee. Other Democratic-aligned groups, including Priorities USA, are planning ad campaigns over the coming year to target the same voters.

Advisers from the Obama campaign include former White House strategist David Plouffe, grass-roots organizer Mitch Stewart and data scientist Dan Wagner.

“Someone needs to treat this with the intensity as if we are already running against Trump. That is not happening,” Plouffe said. “In a narrow decision, where three to six states are decided within a couple points, this sort of effort could be a big deal.”

In his contemplations about joining the presidential race, Bloomberg had promised a campaign based on his record as a fiscal steward of New York City for 12 years and his philanthropic activism on issues like gun control, global warming and public health.

His aides planned to emphasize his own life story as a self-made businessman, who rose from a modest upbringing in Massachusetts to rank as the ninth-wealthiest person in the world, according to Forbes. Bloomberg has previously dismissed Trump’s business accomplishments, saying he was just a “real estate promoter.”

“I never would have been elected three times in a row without trying to win over voters in the middle, and ultimately I believe that makes for better governing,” Bloomberg said at a 2018 Democratic Party event in Pennsylvania.

Now that sort of campaign pitch will be put back on the shelf, after similar aborted campaign efforts in the 2008 and 2016 cycles.

Fellow billionaire Howard Schultz, the former Starbucks CEO who is considering an independent bid for president in 2020, said Bloomberg’s decision proved his point that there was little room in today’s Democratic Party for centrist candidates.

“Mike Bloomberg is inarguably one of the most effective leaders of government our country has seen this generation — because he governed from the center with big ideas, pragmatism and common sense. In an era of paralysis and dysfunction, he has been an exception. I’ve long said that there isn’t room for centrist moderation in either party and it appears Mr. Bloomberg has come to that same conclusion,” Schultz said in a statement.

But Bloomberg’s aides say he has no intention of staying out of politics and may still get involved in the Democratic primary battle as a supporter.

“You should expect to hear a lot more from Mike Bloomberg,” said Kevin Sheekey, Bloomberg’s longtime political adviser. “Some people don’t run, and you don’t hear from them again. I think the reverse is true here.”

Shortly after Bloomberg made the decision Monday, his aides decided to go through with a previously scheduled meeting with outside vendors to decide on a campaign logo. The team had built a campaign website and planned a launch that would begin in his hometown of Medford, Mass.

“What we basically told him was we were going to build a car, and we were going to give him the keys,” said Howard Wolfson, a Bloomberg political strategist who helped draft the plans. “If he wanted to turn the car on, the car was going to work, and it was going to go fast and it was going to look good.”