President Trump is facing two big tests of his presidency as November's midterm elections draw closer: the caravan of thousands of Central American migrants and this week's mysterious bomb threats.

The threats pose a challenge to the Trump administration on how to respond without alienating the Republican base or crucial swing voters that may determine the outcome of House, Senate and gubernatorial races across the country.

On the caravan issue, where thousands of migrants are marching through Mexico toward the U.S. border, Trump is reportedly considering a sweeping executive order that would block asylum-seekers from entering the country.

It would be a decisive measure – resembling the Trump administration’s previous executive orders to curb migration from some Muslim-majority countries – and would likely energize the Republican base, which sees immigration as one of the main issues of the midterm elections.

But the move could cause a backlash as it would draw attention to the White House -- a source of division among voters -- and away from local Republican candidates, some of whom hold sharply different views than the president.

TRUMP MULLS PLAN TO BAR ENTRY OF ALL MIGRANTS AT US-MEXICO BORDER

If the executive order goes ahead, the images of thousands of migrants and asylum-seekers stranded at the U.S. border may prompt outrage similar to that of last summer, when children were separated from their parents as families tried to cross into the U.S. illegally.

The outcry forced Trump to concede and sign an executive order effectively reversing U.S. Attorney General Jeff Sessions’ “zero-tolerance” policy at the border and allowing children to stay with parents caught crossing the border illegally.

On the issue of explosive devices being sent to multiple Democratic politicians and CNN, Trump immediately called for unity, saying the incidents were “abhorrent.”

“The safety of the American people is my highest and absolute priority,” Trump said Wednesday. “The full weight of our government is being deployed to conduct this investigation and bring those responsible for these despicable acts to justice. We will spare no resources or expense in this effort.”

He continued: “In these times, we have to unify. We have to come together, and send one very clear, strong, unmistakable message that acts or threats of political violence of any kind have no place in the United States of America.”

"In these times, we have to unify. We have to come together, and send one very clear, strong, unmistakable message that acts or threats of political violence of any kind have no place in the United States of America."

— President Trump

EXPLOSIVE DEVICES MAILED TO OBAMA, HILLARY CLINTON, OTHERS PROMPT SECURITY SCARE

Top Democrats jumped on Trump’s remarks, saying his remarks “ring hollow.” They accused him of condoning “political violence.”

"President Trump's words ring hollow until he reverses his statements that condone acts of violence," Senate Minority Leader Chuck Schumer and House Minority Leader Nancy Pelosi said in a statement on Wednesday.

“Time and time again, the President has condoned physical violence and divided Americans with his words and his actions: expressing support for the congressman who body-slammed a reporter, the neo-Nazis who killed a young woman in Charlottesville, his supporters at rallies who get violent with protesters, dictators around the world who murder their own citizens, and referring to the free press as the enemy of the people.”

The president returned Thursday to criticize the media and blamed it for incivility.

“A very big part of the Anger we see today in our society is caused by the purposely false and inaccurate reporting of the Mainstream Media that I refer to as Fake News,” Trump wrote in a tweet. “It has gotten so bad and hateful that it is beyond description. Mainstream Media must clean up its act, FAST!”

A former top adviser to Hillary Clinton said earlier this week that the suspect or suspects linked to a rash of explosive devices sent to Democrats, such as former President Barack Obama and the Clintons, could have been inspired by Trump’s messages.

EX-CLINTON ADVISER SAYS TRUMP'S TWITTER MESSAGES MAY HAVE INSPIRED BOMB SUSPECT

Philippe Reines said on MSNBC that the rhetoric coming from the White House can’t be dismissed in the wake of the bomb scare.

“If you look at who they’ve targeted so far, it’s almost as if they’re following Donald Trump’s Twitter feed," Reines said Wednesday on "Andrea Mitchell Reports," adding that not everyone in public office has access to Secret Service protection.

But the Trump administration forcefully pushed back against suggestions that it shares the responsibility.

White House press secretary Sarah Sanders told reporters Thursday that Trump is “certainly not responsible for sending suspicious packages to someone, no more than Bernie Sanders was responsible for a supporter of his shooting up a Republican baseball field practice last year.”