Former President Barack Obama is ridiculing President Trump and Republicans for vowing to stop the caravan of 4,000 Central American migrants heading toward our border. Republicans are “trying to convince everybody to be afraid of a bunch of impoverished, malnourished refugees,” says Obama. House Minority Leader Nancy Pelosi blasts Republicans for stoking “baseless fear” in the lead-up to Tuesday’s election.

Baseless fear? Democrats aren’t leveling with you about the welfare, health benefits and education resources these migrants will consume, if they’re allowed in.

Democrats are also claiming the US has to let the migrants in, because they’re seeking asylum. The truth is, the US Constitution and federal law give the president the authority to block their entry.

Trump’s critics portray migrants as families fleeing for their lives. Don’t believe it. Few are truly legitimate asylum seekers. Mexico launched a “Make Yourself at Home” program, offering migrants shelter, food, work and schools for their kids. Most turned it down. They’re heading to the US for a lifestyle upgrade, knowing that uttering the words “asylum” and “credible fear” to a US border agent is a get-in-free card.

More than half never apply for asylum, according to Attorney General Jeff Sessions. They just melt into the US interior. Of those who apply, only a minuscule 8.3 percent qualify.

These migrants are making a mockery of asylum.

Trump is halting this hoax. At the White House last Thursday, he previewed an executive order expected this week. Step One: targeting migrants who cross the border illegally.

Every month, thousands wade across the Rio Grande or scale fences, then plead asylum to a border agent. They’re taken into custody briefly, released and told to appear at an immigration hearing. Surprise: They almost never do.

Trump announced an end to this “catch and release” fiasco. Soldiers are laying barbed wire to deter illegal crossings, but those who get through will be detained in tent cities until their claims are heard.

Amazingly, attorneys for six Hondurans in the caravan sued the Trump administration last week for violating their constitutional rights. History shows they don’t have a legal leg to stand on.In 1981, President Reagan deployed the US Coast Guard to turn back boatloads of migrants trying to enter illegally and claim asylum. Reagan called the attempted mass migration “detrimental to the interests of the United States.”

Attorneys for the seafaring migrants sued, but the US Supreme Court backed up Reagan, ruling the Executive Branch has the “discretion” to grant or not grant asylum (Sale v. Haiti). Illegal immigrants do not have a constitutional right to come in, period. Even to seek asylum. Whether they’re on boats or in caravans on land.

What about migrants who line up at official border entrances instead of sneaking in? Trump skirted the issue on Thursday but he has the authority to deny them entry, too. Section 212(f) of the Immigration and Nationality Act gives the president broad discretion, even in the case of refugees and asylum-seekers.

Last year, in Trump v. Hawaii, the Supreme Court confirmed that the president can turn away aliens who are “detrimental to the interests of the United States.”

Using that test, who can doubt the right thing to do? Already, there may be 22 million illegal immigrants in the United States, according to new research by Yale and MIT statisticians, double what is commonly acknowledged. Federal taxpayers pay billions of dollars a year to fund community health clinics primarily used by illegal immigrants, while local taxpayers foot school bills for their children.

When migrant children lacking English skills and school experience are placed in public schools here, they require enormous resources. Too bad for the rest of the kids.

Worse, dozens of Central American migrant children have been arrested as “suspected gang members” of the violent MS-13 street gangs, according to US Citizenship and Immigration Services.

How can anyone so easily dismiss the problems migrants bring to our nation?

Betsy McCaughey is a senior fellow at the London Center for Policy Research.