WASHINGTON -- As U.S. President Joe Biden looks to dismantle the last administration's hardline immigration agenda, he worked Monday to build a partnership with someone who found an unexpected understanding with Donald Trump: Mexican President Andres Manuel Lopez Obrador.

Biden and Lopez Obrador met for a virtual bilateral meeting, with immigration, the coronavirus pandemic and climate issues on the agenda. Looming large was how the two leaders would get along in what has become an increasingly complicated relationship.

"We haven't been perfect neighbours to each other," Biden acknowledged in brief remarks at the start of his video conference meeting with the Mexican president.

Lopez Obrador, for his part, told Biden that he was thankful that the new president was "willing to maintain good relations for the good of our people in North America."

The Mexican president also gave a wink to a rueful observation attributed to Jose de la Cruz Porfirio Diaz Mori, the Mexican general who served seven terms as the country's president, about the two countries' relationship: "Poor Mexico, so far from God, so close to the U.S."

"I can now say `It's wonderful for Mexico to be close to God and not so far from the United States"' Lopez Obrador said.

Lopez Obrador came to the meeting with his own checklist of priorities, including pressing Biden to give pharmaceutical company Pfizer permission to sell his country vaccine produced in the United States, something that Canada has also requested from the White House.

"We want to have an answer about a request we made," Lopez Obrador told reporters at his daily news conference, hours before speaking with Biden.

Ahead of the meeting, White House officials reiterated that Biden remained focused on first vaccinating U.S. citizens before turning his attention to assisting other nations. Biden, in a brief exchange with reporters at the start of the meeting, said the two leaders would discuss vaccines.

The two sides following the meeting issued a joint statement pledging greater co-operation on addressing migration, the coronavirus pandemic, and climate change. The Mexican government in a separate statement added the two sides also agreed to crack down on migrant trafficking.

Relations with Biden will be much more complex and multi-faceted than they were with Trump.

As a candidate, Trump referred to Mexicans as rapists. The Republican's signature campaign promise was building a "big, beautiful wall' across the length of the southern border. And leaked conversations showed Trump hectoring Lopez Obrador's predecessor, Enrique Pena Nieto, against publicly saying that Mexico would never pay for a southern border wall.

But Lopez Obrador appeared to reach a one-issue understanding with Trump: Mexico stopped the flow of Central American migrants trying to reach the U.S. border, and Trump often appeared to turn a blind eye to just about every other facet in the complicated relationship.

There was no shortage of issues that Trump largely overlooked or played down in exchange for Mexico slowing the flow of undocumented immigrants from the border.

Lopez Obrador, who took office in 2018, accused U.S. officials of fabricating drug trafficking charges against the country's former defence secretary, Gen. Salvador Cienfuegos, and demanded the general's return after he was arrested in Los Angeles in October. U.S. prosecutors eventually acquiesced.

Under his watch, Lopez Obrador has attempted to consolidate the position of Mexico's national oil company and national electric utility, and prioritized fossil fuel companies amid a global push to curb greenhouse gas emissions.

Early in his term, the Mexican president pursued a counter-narcotics strategy that largely ended the pursuit of high-profile arrests and focused more on poverty alleviation.

Still, Trump heaped praise on Lopez Obrador, calling him a "friend" and "great president" in one of his final presidential speeches, an address from the border to celebrate progress made on building the wall.

The effort to reset the U.S.-Mexico relationship under Biden comes as a flood of migrants have rushed to the border since his victory in November.

Biden has backed a bill to give legal status and a path to citizenship to the estimated 11 million people living in the country illegally. Biden also broke with Trump by supporting efforts to allow hundreds of thousands of people who came to the U.S. illegally as young children to remain in the country.

Border Patrol agents are apprehending an average of more than 200 children crossing the border without a parent per day, but nearly all 7,100 beds for immigrant children maintained by the Department of Health and Human Services are full.

Homeland Security Secretary Alejandro Mayorkas on Monday sought to push back against the notion that the situation at the border was spinning out of control.

"The men and women of the Department of Homeland Security are working around the clock seven days a week to ensure that we do not have a crisis at the border, that we manage the challenge as acute as the challenge is, and they are not doing that alone," Mayorkas said.

Ahead of the meeting, Lopez Obrador also floated a proposal for a Bracero-style immigrant work visa program for 600,000 to 800,000 Mexican and Central American workers annually.

Asked about the Mexican president's proposal, White House press secretary Jen Psaki said that reinstituting the Bracero program would require action by Congress.

The original Bracero program allowed Mexicans to work temporarily in the United States to fill labour shortages during World War II and for a couple of decades after the war. Lopez Obrador said the U.S. economy needs Mexican workers because of "their strength, their youth."

On Monday, Lopez Obrador added that his new proposal would be a program not only for agriculture workers but for other sectors and professionals.

------

Stevenson reported from Mexico City and Madhani from Chicago. Associated Press writers Elliot Spagat and Josh Boak contributed reporting.