President Biden and other top officials hold a virtual meeting with Mexican President Andrés Manuel López Obrador from the White House. (Kevin Lamarque/Reuters)

President Biden met with Mexican President Andrés Manuel López Obrador on Monday amid growing pressure to find a workable immigration policy, as he faces criticism from liberal Democrats for detaining migrant children and accusations from Republicans that he is recklessly throwing open the nation’s borders amid a pandemic.

Biden and López Obrador issued a joint declaration affirming their will to cooperate on migration issues, particularly the long-term goal of creating more jobs in southern Mexico and Central America. But whether Biden can get Mexico’s immediate help to contain the growing border influx was not clear.

A surge of unaccompanied minors at the border has put an early strain on Biden’s presidency as he pushes to reverse the immigration policies of former president Donald Trump. Biden has frozen construction of the border wall, curbed deportations and welcomed asylum seekers that his predecessor sought to keep in Mexico.

In Monday’s meeting, Biden made it clear he felt ties between the two countries could improve significantly. “There’s a long and complicated history between our nations, and we haven’t always been perfect neighbors with one another, but we have seen over and over again the power and purpose when we cooperate,” Biden said.

López Obrador also hinted that relations between the two countries have left something to be desired. “It is important that we base our good relationship on constant dialogue,” he said. “I know our relations in the future will be even better.”

Mexican officials said the meeting, scheduled for 45 minutes, stretched on for twice that time, and was cordial. The topics included migration, development, the economy, climate change and the pandemic. Mexican officials said they emphasized the importance of opening up more legal pathways for migrants, an idea that the Biden administration has supported.

There is little doubt the immigration issue has vexed the early weeks of the Biden presidency, and the political stakes are only likely to increase in coming weeks.

López Obrador came to Monday’s meeting with requests of his own, including help in ensuring that coronavirus vaccines are available to poorer countries such as Mexico, which has been devastated by the pandemic. “We’re going to talk about that,” Biden said Monday, but declined to say whether he would agree.

Mexico City deaths spiked to three times normal during covid-19 outbreak, official says

The Mexican president also planned to propose a new temporary worker program that could bring 600,000 to 800,000 Mexican and Central American immigrants into the United States annually.

The challenge of immigration was evident elsewhere Monday, as well. U.S. Customs and Border Protection said it was sending personnel from northern and coastal stations to the Rio Grande Valley, where agents have been increasingly diverted to cope with the growing numbers of families, teens and children crossing from Mexico.

And a day after Trump blasted Biden’s border policies, Secretary of Homeland Security Alejandro Mayorkas said it was Trump’s administration that was at fault for the growing number of unaccompanied minors held in U.S. custody after crossing the Mexico border.

The former president’s policies left Biden with a “gutted” immigration system, Mayorkas said, adding that detention of children represents a “challenge” rather than a “crisis.”

“We are challenged at the border,” Mayorkas said. “It is a stressful challenge.”

Watch: Mayorkas says U.S. faces challenge, not crisis, on border

Biden’s virtual session with López Obrador continued his effort to restore traditional alliances after Trump’s fiery tenure, including solidarity across North America. Biden met last week with Canadian Prime Minister Justin Trudeau, who was clearly relieved to be dealing with Biden instead of Trump.

The meeting with López Obrador was more fraught. The left-wing populist was among the last major foreign leaders to recognize Biden’s victory. He had forged a surprisingly close partnership with Trump; both were charismatic campaigners who built popular movements as political outsiders.

The coronavirus pandemic has now given another twist to U.S.-Mexico relations. López Obrador is a vocal critic of global inequity in vaccine distribution, and he said Monday before the meeting that would be a top subject at the session with Biden.

A reporter asked López Obrador whether he would press Biden to authorize U.S.-based firms to sell their vaccines to other countries. “If President Biden wishes, he can give us an answer in the conversation about the vaccines,” López Obrador responded. “We have to be respectful, but it’s a subject that matters a lot to us.”

Mexico is vaccinating its poorest citizens first — against the advice of health experts

But the overriding issue between the two countries remains migration.

Biden during his campaign often denounced Trump’s treatment of migrant children in particular as “inhumane.” But he angered some fellow Democrats last month when his administration opened its own tent facility in South Texas to cope with the growing number of minors in government custody.

That facility was far different from the austere Border Patrol warehouse that was central to Trump’s 2018 family separation crackdown, but many activists still found it hard to square with Biden’s promise of a more humane approach.

A U.S. diplomat familiar with Latin American issues said the Biden administration wants to work with López Obrador on migration, as well as other issues, but acknowledged that “it’s a complicated relationship right now.” He spoke on the condition of anonymity to deliver a frank assessment.

Speaking before Monday’s meeting, the diplomat said that on border security, the message would be that “we’re open to ideas” because the current situation “is just not tenable.”

“It’s their country,” the diplomat added, emphasizing that Biden would respect Mexico’s sovereignty. However, he said, “What we’re not going to do is pretend there’s no problem.”

Meanwhile, Trump — who rode a tough-on-immigration message to the White House in 2016 and has hinted at another run in 2024 — has wasted little time attacking Biden as soft on the issue.

“When I left office just six weeks ago, we had created the most secure border in U.S. history,” Trump said Sunday in a speech to the Conservative Political Action Conference, disregarding the rising number of illegal crossings recorded during his last several months in office.

“It took the new administration only a few weeks to turn this unprecedented accomplishment into a self-inflicted humanitarian and national security disaster,” Trump said.

Sieff reported from Mexico City.

Coronavirus: What you need to know

Covid isolation guidelines: Americans who test positive for the coronavirus no longer need to routinely stay home from work and school for five days under new guidance planned by the Centers for Disease Control and Prevention. The change has raised concerns among medically vulnerable people.

New coronavirus variant: The United States is in the throes of another covid-19 uptick and coronavirus samples detected in wastewater suggests infections could be as rampant as they were last winter. JN.1, the new dominant variant, appears to be especially adept at infecting those who have been vaccinated or previously infected. Here’s how this covid surge compares with earlier spikes.

Latest coronavirus booster: The CDC recommends that anyone 6 months or older gets an updated coronavirus shot, but the vaccine rollout has seen some hiccups, especially for children. Here’s what you need to know about the latest coronavirus vaccines, including when you should get it.