WASHINGTON — President Donald Trump’s sharp shift in tone on immigration this week from would-be dealmaker back to the hard-line stance he campaigned on comes amid signs that some of his conservative base is growing impatient for him to fulfill promises on the border wall and other measures to crack down on illegal immigration.

Over the past two days, Trump has issued declarations on Twitter that shut the door on a legislative deal to protect young undocumented immigrants from deportation, blamed Democrats for the failure, demanded the Mexican government take stronger action to close the border, and conflated a refugee crisis from Central America with the Obama-era deferred-action program that Trump ended in the fall.

In doing so, Trump has again fanned fears that U.S. immigration policies have weakened the country and led to public safety risks, even though illegal immigration is at some of the lowest levels in years.

“Must build Wall and secure our borders with proper Border legislation,” Trump wrote Monday in one of several tweets about immigration. “Democrats want No Borders, hence drugs and crime!”

[Trump says ‘no more’ DACA deal and threatens to ‘stop’ NAFTA if Mexico does not better secure border]

Trump had, in recent weeks, cast himself as remaining open to an immigration deal on Capitol Hill even after the White House helped scuttle a bipartisan plan in February that would have provided a path to citizenship for young immigrants known as “Dreamers” and authorized $25 billion toward the president’s border wall. Immigration talks continued through much of March but collapsed after Congress approved a $1.3 trillion spending bill two weeks ago that did not include an immigration deal or funding for many of the tougher border security measures the administration proposed.

Since then, Trump has faced growing criticism from some conservatives who had supported him — most prominently commentator Ann Coulter — over his inability to secure funding for the wall, which he had initially promised Mexico would pay for.

“I don’t know what more horrible thing you could come up with than violating your central campaign promise that became the chant and the theme of the campaign that he promised at every single rally,” Coulter said in an interview with The New York Times over the weekend.

Asked whether Trump fears a backlash from his voters over immigration, Coulter wrote in an email to The Washington Post: “He ought to!”

Trump has been privately fuming off and on about the spending bill since he threatened to veto it at the last minute before reluctantly signing it into law last month — which he said he did only because it included a big spending increase for the military.

The bill provides $1.6 billion toward border barriers — far from enough for the 700 miles of wall Trump has promised. Even that funding comes with several restrictions, meaning it will mostly go toward fencing similar to what is already in place in some areas rather than the type of wall Trump has touted. The president has blamed House Speaker Paul Ryan, R-Wisconsin, and Senate Majority Leader Mitch McConnell, R-Kentucky, for being poor negotiators, according to people familiar with criticism of the funding bill.

Trump’s frustrations reached a boil over the holiday weekend as he vacationed with his family at Mar-a-Lago, his private club in Palm Beach, Florida. Trump was accompanied there by only a small retinue of staff, including senior policy adviser Stephen Miller, a proponent of strict anti-immigration policies. The president also mingled with a number of other immigration hard-liners, including Sean Hannity, a Fox News and conservative radio host.

[Trump, inspecting wall prototypes, slams California governor for ‘doing a terrible job’]

Trump’s focus on border and immigration issues also follows a briefing he received late last week from Homeland Security Secretary Kirstjen Nielsen, according to a person familiar with the meeting. It’s not clear exactly what piqued Trump’s interest most, but among the issues discussed were the wall, the “caravan” highlighted in conservative media and the Obama-era Deferred Action for Childhood Arrivals program.

Trump was fired up after the briefing, this person said, and that was further fueled by segments on Fox and Friends this weekend.

In his string of immigration tweets on Sunday and Monday, Trump seized on the recent reports, first by BuzzFeed News and then highlighted on Fox News and other conservative outlets, that a “caravan” of more than 1,000 migrants, mostly from Honduras, is traveling north to seek asylum in the United States without interference from Mexican authorities.

“Honduras, Mexico and many other countries that the U.S. is very generous to, sends many of their people to our country through our WEAK IMMIGRATION POLICIES,” Trump tweeted Monday night. “Caravans are heading here. Must pass tough laws and build the WALL. Democrats allow open borders, drugs and crime!”

The so-called caravan is actually an annual event organized by immigrant advocacy groups aimed at drawing public attention to the ongoing refugee crisis from Central America, a region wracked by rampant gang violence and drug trafficking.

Trump has inaccurately responded to the reports by suggesting that the group is motivated by the desire of the immigrants to take advantage of DACA, the Obama-era program that Trump announced in September would be phased out. In fact, any immigrants who had not lived in the country continuously for at least five years by June 2012 are not eligible for DACA.

White House aides argued Monday that the DACA program was a “pull factor” for Central American immigrants, who have begun entering the country illegally in rising numbers since the fall. They said that negotiations in Congress over a legislative solution to protect “Dreamers” and potentially offer them a path to citizenship raised hopes in Honduras and elsewhere that there will be “never-ending leniency,” according to one senior White House official who briefed reporters on the condition of anonymity.

“One of the things you hear from front-line operators, when Congress is debating a large grant of a generous immigration benefit, that tends to be a major pull factor for new people to come illegally,” the official said.

[Trump revives push to limit family sponsorships for immigrants]

Immigrant rights advocates said Trump has purposely sought to conflate DACA with the rise in immigrants from Central America — which has been a problem since the Obama administration sought to stanch a wave of migrants, most of them women and children from Honduras, Guatemala and El Salvador, that overwhelmed Border Patrol stations in 2014.

“It is truly to play to his base,” said Wendy Young, president of Kids in Need of Defense, which advocates for immigrant children. “His waffling back and forth on DACA — you never know, day-to-day, what he stands for. He’s trying to juxtapose the movement of Central Americans against that to build up his street cred again with his base.”

The surge of immigrants entering the country illegally peaked in 2014, with more than 68,000 unaccompanied minors and a similar number of people traveling as families caught, prompting the Obama administration to respond by adding more detention centers, pledging aid to Central American countries and pressing Mexico to tighten its southern border.

But those measures have done little to fix the problem. Though overall illegal immigration levels have dropped under Trump, the number of Central Americans has risen sharply again in recent months, prompting concern among the president’s advisers.

Cecilia Munoz, Obama’s domestic policy adviser, said Trump “doesn’t understand the way immigration policy works and is trying very clearly to stoke up rationales for policies and approaches that are not based in fact.”

[Border arrests plunge to 45-year low while deportation arrests soar under Trump]

White House aides rejected the notion that Trump is disappointing his core supporters. They emphasized that planning is underway to build or refurbish up to 100 miles of the border barriers and said the administration is preparing a new package of immigration proposals to deliver to Congress in an attempt to close existing “loopholes” in the law.

Among the changes the administration is seeking is a provision to allow the United States to more quickly deport unaccompanied children from Central America, who currently have more legal protections than do those from countries neighboring the U.S. border, such as Mexico.

The Department of Homeland Security, meanwhile, is pushing to end “catch and release,” a long-standing practice of freeing up space at immigration detention centers that officials say has allowed undocumented immigrants to be resettled in the United States as they await hearings in immigration courts with lengthy backlogs.

Lars Larson, a conservative talk radio host who supports Trump, acknowledged that Coulter, whom he considers a friend, is “ready to throw him under the bus,” but he added that she does not represent most of Trump’s base.

Asked if the president missed an opportunity to secure more wall funding in the DACA negotiations, Larson responded: “Perhaps. But he felt he had to make other compromises he was not willing to make.”

Washington Post writers Philip Rucker, Seung Min Kim, Josh Dawsey and Nick Miroff contributed to this report.

Follow the Bangor Daily News on Facebook for the latest Maine news.