Former HUD secretary Julian Castro and former congressman Beto O'Rourke of Texas address each other as Sen. Cory Booker of New Jersey and Sen. Elizabeth Warren of Massachusetts look on during the first Democratic primary debate on Wednesday. (Jim Watson/AFP/Getty Images)

Immigration dominated the first Democratic debate of the 2020 White House race as the candidates staked out concrete policy proposals on the border crisis, their discussion charged with emotion in the wake of a widely circulated photo of a father and daughter who drowned trying to cross the Rio Grande.

Several of the 10 presidential contenders onstage Wednesday addressed the Miami audience with statements in Spanish, and immigration topics triggered some of the most contentious exchanges of the evening.

Julián Castro, a former secretary of housing and urban development, has been the first Democrat to offer a detailed immigration plan, and he immediately challenged rival candidates to endorse its boldest idea: repealing the legal code that makes crossing the border illegally a federal offense.

Castro said he would get rid of Section 1325 of the Immigration and Nationality Act “to go back to the way we used to treat this — when somebody comes across the border, not to criminalize desperation, but to treat that as a civil violation.”

With President Trump vowing to deport millions and fast-track hundreds of miles of “border wall,” immigration enforcement probably will remain a central theme of the 2020 campaign, and Castro’s call to diminish border enforcement sent the Democrats to the opposite extreme of the president’s approach.

“I will make sure that, number one, we end the ICE policies and the customs and border policies that are violating the human rights,” said Sen. Cory Booker of New Jersey. “When people come to this country, they do not leave their human rights at the border.”

When former congressman Beto O’Rourke of Texas was asked — in Spanish — what he would do, Castro cut him off and criticized him for defending “criminalization” of those who cross illegally.

“We would not detain any family fleeing violence,” O’Rourke said, appearing to seek a middle ground at a time when unauthorized migration is at a 13-year high, with more than 144,000 arrests along the border in May.

Most of the candidates said they would not separate families, and appeared to endorse the practice Trump bemoans as “catch and release” that frees border-crossers from custody to await a court hearing that may be months or years into the future. Homeland Security officials blame the practice for fueling an unprecedented surge of families and children traveling alone.

Castro also said he would eliminate Trump-era immigration policies including “metering,” which he blamed for the drowning deaths of the Salvadoran father and 23-month-old girl in the photo.

“That image of Oscar and his daughter, Valeria, is heartbreaking,” he said, adding: “It should spur us to action.”

Metering is the practice of limiting the number of people allowed to approach U.S. border crossings to apply for asylum. Customs and Border Protection officials implemented the practice widely when the number of asylum seekers surged last year, insisting that U.S. border officers are too busy with their standard tasks — inspecting cars, cargo and passports — to process unlimited numbers of asylum claims each day.

With tens of thousands of Central America migrants waiting on the Mexican side to cross, it may be months before they are allowed to start the process. But U.S. officials say it is unrealistic to expect CBP officers to provide on-demand asylum processing at a time when so many are arriving to the border and agents are stretched thin.

Castro said he would also eliminate the “Remain in Mexico” policy that requires a growing number of asylum seekers to wait outside the United States while their claims are processed. Homeland Security officials say the program is necessary because too many migrants are filing meritless asylum claims to avoid detention and deportation.

Several candidates denounced the Trump administration for separating migrant families, but since the end of the “Zero Tolerance” crackdown last June, U.S. officials say they have done so only in rare instances when they determine that there is a safety or health risk to the child, or that the adult was not the child’s parent.