WASHINGTON>> On President Joe Biden’s first day in office, he paused nearly all deportations. He vowed to end the harsh practices of the Trump administration, show compassion toward those wishing to come to the United States and secure the southern border.

For Biden, it was a matter of principle. He wanted to show the world that the United States was a humane nation, while also demonstrating to his fellow citizens that government could work again.

But those early promises have largely been set aside as chaos engulfs the border and imperils Biden’s reelection hopes. The number of people crossing into the United States has reached record levels, more than double than in the Trump years. The asylum system is still all but broken.

On Friday, in a dramatic turnaround from those early days, the president implored Congress to grant him the power to shut down the border so he could contain one of the largest surges of uncontrolled immigration in American history.

“If given that authority,” Biden said in a statement, “I would use it the day I sign the bill into law.”

Some of the circumstances that have created the crisis are out of Biden’s control, such as the collapse of Venezuela, a surge in migration around the world and the obstinance of Republicans who have tried to thwart his efforts to address the problems. They refused to provide resources, blocked efforts to update laws and openly defied federal officials charged with maintaining security and order along the 2,000-mile border.

But an examination of Biden’s record over the last three years by The New York Times, based on interviews with more than 35 current and former officials and others, shows that the president has failed to overcome those obstacles. Many voters now say immigration is their top concern, and they do not have confidence that Biden is addressing it.

The president initially sought balance. He created legal pathways for migrants and began rebuilding the refugee system even as he embraced some of former President Donald Trump’s more restrictive tactics. But those efforts were quickly overwhelmed by the sheer numbers of people arriving at the border, and at times Biden failed to appreciate the growing anger in both parties. During the 2020 campaign, Biden said he would be an antidote to his predecessor’s anti-immigrant approach. But after years of inflation, economic suffering and political polarization, the public is divided about whether the United States — which is home to more immigrants than any other nation — should absorb more.

Biden went from a 2020 candidate who vowed to “end Trump’s assault on the dignity of immigrant communities” to a 2024 president who is “willing to make significant compromises on the border.”

When children from Central America started crossing by the thousands in spring 2021, the president’s first instinct was compassion. Biden believed he was elected to deal with immigration in a humane manner.

It was the first big test of his immigration agenda and of whether the more welcoming approach he promised would work.

During his campaign for the White House in 2020, Biden pledged to limit raids by Immigration and Customs Enforcement, invest in the asylum system and close private immigration prisons. On his first day in office, he proposed a vast immigration bill to Congress that would have provided a path to citizenship for millions of immigrants already living in America without legal permission.

The next day, he paused deportations for 100 days, and even though a federal judge later blocked that policy, some migrants took it as a sign that it was worth a dangerous trek to the U.S. border.

Republicans seized the moment. They declared Biden’s immigration overhaul dead on arrival and warned that human traffickers and smugglers would funnel migrants to America with the false promise that the new president was throwing open the border — a risk that some inside the administration agreed with, according to several current and former U.S. officials.

The president dismissed the criticism.

But Biden’s more welcoming stance was quickly tested. In April 2021, he had expanded the number of Haitians who could stay in the United States after fleeing gang violence in their country. But the administration also decided that if a surge of Haitians arrived at the border, the United States would send them right back, using a COVID-era authority known as Title 42.

It did not take long. During a 16-day period in September 2021, 19,752 Haitians crossed into a makeshift camp under the Del Rio International Bridge in Texas.

Many of the Haitians were allowed to stay in the United States, with notices to appear in immigration court, because of limits on the Border Patrol’s capacity to remove them from the country. But thousands were deported.

The rapid deportations exposed a split in the administration that would only grow over time.

People close to Biden said he had always supported enforcing the law. But others in the administration saw the treatment of Haitians as a betrayal of the values that Biden had promised to uphold.

Pressure was building on Biden to find a solution. He looked to the one place that could pass meaningful new immigration laws but has not done so in decades: Congress.

But Republicans in Washington largely ignored Biden’s entreaties to come to the negotiating table to help fix the immigration system. And out in the country, GOP officials came up with their own plan. In April 2022, Gov. Greg Abbott of Texas vowed to “take the border to President Biden” by busing thousands of migrants to Democratic-led cities. It was a stunt, but it worked.

Democratic leaders were overwhelmed. They called for the president to step in, saying the influx was a drain on their resources. The people demanding border security were no longer just Republicans. They were members of Biden’s own party.

The administration scrambled to meet the Democratic demands, providing more money and speeding up the processing of work permits.

But the busing of migrants clearly shifted the discourse around the issue. And polling began to show growing support in the United States for border measures once denounced by Democrats and championed by Trump.