Michael R. Bloomberg, the billionaire former mayor of New York City who is considering a 2020 presidential campaign, took another step closer to that possibility Sunday with a $5 million national advertising effort that encourages voters to support Democrats in Tuesday’s midterm elections — and offers Bloomberg’s centrist politics as a counter to President Trump.

Bloomberg’s two-minute television ad, which features him speaking directly to the camera and standing before an American flag, first aired Sunday during CBS’s “60 Minutes.” It will air again Monday during the evening news programs on broadcast networks and on MSNBC and CNN.

Bloomberg, 76, portrays himself in the spot as a steady and seasoned Washington outsider (hint: presidential) who is appalled by Trump’s conduct and agenda and alarmed by episodes of political violence and Trump’s mounting attacks on the caravan of Central American migrants.

As soft piano notes play, Bloomberg criticizes the “shouting and hysterics” in Washington and the “pointed fingers” and “fearmongering” by Trump on immigration.

A grainy image of Trump flashes for a moment — a quick nod to the man he might challenge.

“Americans are neither naive nor heartless,” Bloomberg says. “We know that we can be a nation of immigrants while also securing our borders.”

Bloomberg’s top political advisers said he firmly believes there is enormous space in the political center and wants Democrats to court voters there and those on the right whose ties to Trump could be fraying. That runs counter to the positioning of many of his potential competitors for a Democratic nomination, who have moved sharply left in recent years.

“When you have the president threatening to shoot migrants at the border, that doesn’t represent the center of the country or most of the GOP,” said Howard Wolfson, a Bloomberg strategist. “It’s critically important to him to talk to those Americans.”

The ad, paid for by Independence USA PAC, a political action committee funded by Bloomberg, will air during broadcasts the president regularly views.

In a statement to The Washington Post on Sunday, Bloomberg said, “The country is deeply divided. The president and Republicans are fueling that division, and that holds us back as a nation. I’m unwilling to sit by and accept it.”

While formally a pitch for Democrats — to whom Bloomberg has given more than $110 million this election cycle — the ad is also revealing of the kind of presentation he could bring to the 2020 campaign trail. He speaks flatly with the faded Boston accent from his youth, devoid of partisan passion and with a technocratic emphasis on competence.

Beyond immigration, Bloomberg makes a broader case in the ad for political centrism in a time of national acrimony and political turmoil, and references the alleged anti-Semitic rampage by a gunman last month at Tree of Life synagogue in Pittsburgh that left 11 people dead. Such an act “tears at the heart” of democracy and humanity, he says.

Bloomberg supplies few solutions, however, beyond asserting that “calm reasoning” should be applied to difficult national issues.

The former mayor — who has been a Republican, independent and Democrat in his political career — also touched on other themes likely to surface if he runs for president: staunch support for gun control, a focus on climate change, and frustration with dysfunction in Congress and the rising federal deficit.

Bloomberg has been traveling to wealthy and highly educated suburban areas outside of Philadelphia and other cities to speak to Democratic audiences. It has been, in part, a charm offensive to Democrats skeptical of him and a political past that has been at times out of step with the party’s base, from his defense of stop-and-frisk policing that civil rights groups denounce as racist to his tangles with labor unions over pensions.

Bloomberg’s $110 million in political spending, dispersed to candidates and committees and related groups, has targeted expensive suburban House races in places such as California and Illinois, while also giving millions to the Democratic campaign to take back control of the U.S. Senate.

The former mayor told The Post in an interview last month that a Bloomberg presidential campaign would not run within the Democratic Party as it exists, exactly. Were it to happen, his campaign would effectively be a bid to reshape the party, and he argued that there is a recent precedent for electoral success by a billionaire who starts a campaign distant from his party’s precepts.

“No one ever thought Trump could win, either,” Bloomberg said.

Michael Scherer contributed to this report.