WASHINGTON - Mexico on Tuesday pledged to spend $1.5 billion to beef up its northern border as its leader met with U.S. President Joe Biden, who faces attacks from Republicans over his handling of immigration on the United States' southern flank.

Casting immigration as a "hemispheric challenge", Biden met Mexican President Andres Manuel Lopez Obrador and top Mexican officials in the White House to address U.S. concerns over migration and Mexico's desire for more worker visas.

In a joint statement, the two governments vowed to take "immediate and coordinated steps to manage the flows of migrants arriving into our countries" and to tackle soaring inflation by boosting bilateral trade and reducing trade costs.

The meeting came a month after Lopez Obrador skipped the U.S.-hosted Summit of the Americas in Los Angeles to protest Biden's decision to exclude the leftist governments of Cuba, Venezuela and Nicaragua.

"Despite the overhyped headlines we sometimes see, you and I have a strong, productive relationship," Biden said in remarks with his Mexican counterpart in the Oval Office.

Biden has struggled with more than 2.8 million arrests at the U.S.-Mexico border since he took office at the beginning of 2021, a record-setting level.

Biden touted a $3.4 billion U.S. investment to upgrade ports of entry along the borders with Mexico and Canada that was part of his bipartisan infrastructure plan passed last year, which he said would make the border safer and more efficient.

Mexico would spend $1.5 billion in border infrastructure between 2022 and 2024, the two governments said. Much of that money has been flagged in recent weeks.

The projects were for the U.S.-Mexico border, aimed at reinforcing infrastructure, extending and upgrading border crossings, as well as for the new Otay Mesa II port of entry between Tijuana and San Diego, a Mexican official said.

The two sides vowed to step up efforts to combat gangs, and Biden said the United States and Mexico would accelerate efforts to stop trafficking of the powerful synthetic drug fentanyl.

Lopez Obrador called on the United States to allow for more legal work visas, but Biden only went as far as highlighting existing programs used by Mexicans and Central Americans.

The Mexican president, who did most of the talking at a joint news event before the meeting, said the U.S.-Mexico-Canada trade agreement (USMCA) could be used to further integrate the three countries and that some tariffs and regulations could be suspended, although he did not specify which ones.

Turning to inflation - a political vulnerability for Biden - Lopez Obrador said some Americans were traveling to Mexico to buy gasoline amid high prices in the United States. He pledged to guarantee twice as much supply to meet that demand.

The two governments also said they would strengthen regional supply chains as well as move towards greener technologies. Mexican state oil firm Petroleos Mexicanos (Pemex) would work with the United States to craft a plan to eliminate flaring and venting in oil and gas operations, they said.

'LONGSTANDING PARTNERSHIP'

Earlier in the day, Lopez Obrador greeted a small crowd of supporters, including a mariachi band, who had gathered outside his hotel. Leaning out a window, he pledged to push for better human rights protections for migrants and legalization for those already in the United States for years.

"The main thing is the defense of our migrant countrymen," he said.

Mexicans have crossed the U.S.-Mexico border illegally in greater numbers in recent years amid strong demand for workers in the United States and a sluggish economy in Mexico.

U.S. Border Patrol made about 70,000 arrests of Mexican migrants in May, up from about 18,000 in the same month in 2019. Some of those caught are repeat crossers, driving up the totals.

Mexicans made up roughly half of the 53 migrants who died in a sweltering tractor trailer during a failed smuggling attempt in San Antonio last month, according to officials.

Republican lawmakers have criticized Biden's approach to the border in the run-up to November's U.S. midterm elections, highlighting the Democrat's stance in opposition to the hardline policies of former President Donald Trump.

The Biden administration has focused on tackling the "root causes" of migration - especially from Central America - putting U.S. Vice President Kamala Harris in charge of addressing complex issues like poverty, violence and climate change.

Harris met with Lopez Obrador on Tuesday morning and emphasized the countries' "longstanding partnership".

The placating words came on the heels of a rhetorical misstep a day earlier by U.S. first lady Jill Biden who attempted to compliment Latinos by saying they were as unique as "breakfast tacos" and later apologized.

(Reporting by Nandita Bose, Ted Hesson, Alexandra Alper and Matt Spetalnick in Washington and Dave Graham, Daina Beth Solomon and Raul Cortes in Mexico City; Editing by Angus MacSwan, Matthew Lewis, Bradley Perrett and Kim Coghill)