A makeshift memorial for shooting victim Kathryn Steinle on Pier 14 in San Francisco, California July 6, 2015.Noah Berger / Reuters

How do you prevent crimes committed by undocumented immigrants?

Parodoxically, America doesn’t need even more intensified efforts to aggressively hunt down unlawful immigrants and deport them.  What it needs is a path to citizenship.

This past weekend, an undocumented immigrant who had reportedly been deported on five previous occasions shot and killed a woman in a busy part of San Francisco. Republican presidential candidate Donald Trump, who had previously made waves for suggesting that most Mexican immigrants were drug dealers and rapists, doubled down in the wake of the San Francisco homicide. Trump argued the shooting provided “yet another example of why we must secure our border.”

And while some in the GOP field took exception to Trump’s remarks, Senator Ted Cruz supported Trump’s conclusion. “I salute Donald Trump for focusing on the need to address illegal immigration,” said Cruz before attacking the idea of immigration reform.

But what if immigration reform is actually the solution?

The current system has left many Latinos—immigrant and native born alike—alienated from law enforcement. In a 2013 study conducted by Lake Research Partners, as well as scholars from PolicyLink and the University of Illinois at Chicago, 45 percent of Latinos reported that fear of police investigating either their own immigration status or the status of people they know makes them less likely to voluntarily offer information about crimes. Even 28 percent of U.S.-born Latinos said that they are less likely to contact police officers even if they’ve been the victims of a crime because they fear police will look into the immigration status of people they know. Among undocumented immigrants, fully 70 percent report they are less likely to contact police.

Without the active cooperation of communities themselves, police find crimes hard to solve and even harder to prevent within those communities. But where communities are partners in rooting out criminality, the results can be dramatic. The Muslim Public Affairs Council found between September 11, 2001 and June 2012, two out of every five al-Qaeda plots threatening the United States had been foiled or prevented with the help of Muslim communities. Since the December 2009 “underwear bomber” plot, Muslim communities had helped law enforcement prevent half of all al-Qaeda-related terror plots. This makes perfect sense. Those in a given community are in the best position to observe threats from within the community and bring those threats to the attention of law enforcement. If, that is, they feel safe to do so.

Trump’s rant reflects the perverse opposition to comprehensive immigration reform, which mistakes bellicosity for effectiveness. When he announced his campaign, Trump argued that Mexican immigrants bring problems to the United States. “They're bringing drugs. They're bringing crime. They're rapists,” he said. “And some, I assume, are good people.” If that were accurate, then building a bigger, badder fence might be a rational response.

Former Texas Governor Rick Perry distanced himself from Trump’s comments. But by traveling the Mexican border with Sean Hannity on a boat mounted with machine guns, he endorsed that same Manichean logic. Thousands of children were then arriving at the border fleeing violence in Honduras and El Salvador. Children. But even then, many on the right felt threatened, and endorsed greater force and more security as the sole solution.

Today under President Obama the border fence is longer and border patrol agents more numerous than ever before. Obama has also deported more undocumented immigrants than any of his predecessors, of either party. Yet there will always be hardened, determined, criminals who slip through the system. The killer in San Francisco is clearly one such example; deported over and over again during the very years in which border security was repeatedly tightened, he kept finding a way back.

Meanwhile, San Francisco, a “sanctuary city” that tries to protect undocumented immigrants from deportation, may have declined to turn this particular man over to federal immigration authorities, and action that would have prevented his crime. That sort of obstruction would be less likely to happen if the vast majority of immigrants no longer had to worry about deportation. And those immigrants would go from becoming victims of the criminal justice system to its allies, reporting and preventing crimes rather than just cowering in the shadows.

Perhaps the irony in all of this is that if Donald Trump were right, policing and immigration reform would be easy. We’d just round up all the immigrants, ship them away, and crime would disappear. But most immigrants, like most native-born Americans, are simply hardworking people trying to feed their families and help their kids succeed. Targeting them won’t end crime, but it will increase their alienation, making effective crime prevention and policing more difficult. If we could finally pass bipartisan immigration reform including a path to citizenship, then immigrant communities could be part of the solution—helping to build America and keep it safe.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.