Last year, 17 people were murdered in the Texas border city of El Paso—a strikingly low number for a city of 830,000. But the number was in keeping with a trend: from 2008 to 2012, El Paso was deemed the safest city in the United States for its size. The reality might seem surprising, given that the city is relatively poor, with a median household income of $40,800 (national average: $53,500) and a poverty rate of 23.4 percent (national average: 15.6 percent), and with a high population of immigrants. Only 21 percent of the community has a college degree, compared with 29 percent nationwide.

El Paso’s safety is doubtless a reflection of the large presence of law enforcement in the city. Not only do you have local police and sheriff’s deputies on the crime beat; you’ve also got federal agents from Homeland Security, including border patrol officers, in addition to FBI, DEA, and even CIA agents, working in a city that is home to Fort Bliss military base and the El Paso Intelligence Center. Worries about border security will likely expand this presence. Texas’s latest budget includes the hiring of 250 extra Texas National Guard members, the creation of a transnational intelligence center, and the purchase of a $7.5 million aircraft and other high-tech security tools—some of which surely will be deployed in El Paso.

The city didn’t always enjoy such a safe reputation. In the early 1990s, El Paso struggled with much higher crime rates, and its northeast neighborhood was known as the Devil’s Triangle, for its high levels of drug dealing, prostitution, and gang violence. An embrace of proactive, community-oriented policing helped turn things around. The police decentralized their structure and set up regional commands that worked closely with residents to address crime. El Paso cops now call the formerly infamous area the Angel’s Triangle.

It’s likely, too, that an aspirational immigrant population played a key role in helping the police make the new approach work. That El Paso residents are hardworking is borne out by the city’s economic numbers, which are encouraging, despite the poverty that persists. Like other cities, El Paso struggled from the economic downturn that resulted from the financial crisis, but the last few years have been impressive. In a recent address, Mayor Oscar Leeser observed: “Back when I took office in 2013, the unemployment rate for the city of El Paso was 9.1 percent. Today, the unemployment rate is 4.4 percent, compared with 4.5 percent in Texas and 5 percent nationally.” Overall, the city has added 4,268 jobs over the past few years. The city now has a vibrant nightlife, thanks in part to the opening of new businesses.

One in every four jobs in El Paso is reliant on the maquiladora industry in Mexico, and city leaders seek to advance the relationship. Mayor Leeser says that he works closely with his counterpart in Ciudad Juárez, El Paso’s sister city across the border: “We travel together to talk about the message of El Paso and Juárez and to help create jobs for our community,” he said.

Yet the reality in Ciudad Juárez is very different from what one finds in El Paso. As a young boy, I walked the streets of Juárez, collecting enough memories to last me a lifetime. I saw the city explode with newcomers, from braceros and other guest workers to factory hands, assembling everything from televisions to car parts. Smugglers supplied Americans with everything from mangos to marijuana. Money flooded in. Yet local leaders had no long-term infrastructure plan—septic tanks, storm drains, roads, parks—for the burgeoning city, where the population soon expanded past 1 million. Juárez continues to suffer from shoddy infrastructure, its dirt roads and sewage spills a marked contrast with El Paso’s paved streets and functioning sewage systems.

The most striking difference was in public order. Even as El Paso was winning kudos for safety, Juárez was becoming known as one of the most dangerous cities in the world. Murders exploded to 3,000 per year, reaching a terrifying 229 per 100,000 in 2010. The main culprit was warfare between rival drug gangs. The conflict began in late 2007, when the Sinaloa cartel, led by Joaquín “El Chapo” Guzmán Loera, tried to wrestle away control of distribution routes leading to the United States from the hometown Juárez cartel. More than 10,000 people lost their lives in what, at times, appeared to be an urban civil war. Kidnappings, extortion, and shootings forced thousands, rich and poor alike, to flee, with many residents crossing the border into El Paso.

Among them was Blanca Barrios, 43. She decided to raise her two children in a quiet neighborhood in El Paso’s Upper Valley. Barrios regularly crosses into Juárez to visit family and run errands. Life in Juárez appears to be improving, but not enough for her to return there. Recently, the family gathered at a park for a Memorial Day weekend cookout. “All I know is that when I cross back into the United States, I feel safer, the fear is lifted,” Barrios said, watching her nephew and her children—Regina, 11, and José Antonio, nine—playing a basketball game known as Around the World. One pretends to be Kobe Bryant; the other, Steph Curry.

In the same park and not far away was the Melendez family, who have also felt the impact of violence in Juárez. For more than two years, they stopped visiting family across the border. Instead, they’d meet at the border fence, where they’d gather to touch the hands of their sisters, aunts, uncles, and cousins through rust-colored steel bars. “We were too scared,” said Julia Melendez, an elementary school teacher. “We saw our city fall apart, and no political will to fix the wrongs. It took away a feeling of comfort, of security that won’t come back overnight.”

The violence took its toll on Juárez’s economy. It was as if the city had imploded from within, losing more than $140 million in new investment. More than 10,000 businesses shut down, transforming once economically vibrant blocks into dead zones, filled with empty storefronts. Neighborhoods stood eerily quiet, seemingly abandoned overnight. The growing violence combined with the financial crisis to hit Juárez particularly hard. More than 90,000 workers lost their jobs—an estimated 30 percent of the workforce. That made some workers vulnerable to cartels looking to recruit hit squads onto their payrolls.

More recently, though, Juárez has seen considerable success in fighting crime. In 2011, the city hired a new police chief with a military background, Julián Leyzaola, a blunt-talking if controversial lawman—he has been accused of strong-arm tactics—who implemented a Broken Windows–style approach to policing. The crime rate has come down—2015 saw 269 homicides in the city—making Juárez safer than popular tourist locations like San Miguel de Allende and the city of Oaxaca, if still far more dangerous than El Paso. Several other factors influenced the improvement. The Mexican government, with some help from the United States, has invested in programs emphasizing civic unity; the police and military presence was beefed up; a citizen-led security committee promoted antiviolence programs; and a new balance of power was established among rival drug gangs, with the Sinaloa cartel dominating its regional competition but coexisting with rivals in some areas of Juárez—reducing violence, for now.

Could Ciudad Juárez become more like El Paso over time? If that’s ever to happen, real judicial reform will be necessary.

Thanks to the crime turnaround, the economy has made real gains over the past few years. Help-wanted ads are back in the newspapers and in store windows. In 2010, there were only 16,500 companies in Juárez, but by early 2015, the number had jumped to 26,500. Most of the growth is attributable to the foreign-owned factory maquiladora industry. As the government showed that it could improve control over violence in Juárez, foreign investors began to put money into the city again.

Could Ciudad Juárez become more like El Paso over time? If that’s ever to happen, real judicial reform will be necessary. Mexico’s legal system is in shambles, failing to punish wrongdoers. According to Mexico’s National Institute of Statistics and Geography, only 10.7 percent of crimes are ever reported in the country. The most common reasons for not reporting crimes are “waste of time” (32.2 percent) and “distrust of the authorities” (16.8 percent)—a plausible response in Juárez, a city in which one recent police chief had spent time in U.S. prison for drug smuggling and where law-enforcement corruption, including bribes, remains rampant. No surprise that of that 10.7 percent of crimes that are reported, only about 3.4 percent are ever resolved. One hopeful development: Mexico is set to introduce an adversarial judicial model, with oral arguments—the old system was based on written testimony and evidence—which is expected to increase transparency.

Still, El Paso benefits from an incalculable advantage: the rule of law, ingrained in American cultural attitudes. In May, a water pipeline broke in Colonia Anapra. Within minutes, raw sewage was running down a street in the impoverished community on the outskirts of Ciudad Juárez, bordering El Paso. José Vejar Castro, the lone security guard watching over city property, borrowed tires from neighbors and went to work the only way he knows—improvising. He placed the tires strategically along a dirt street on top of the broken pipe, creating a barricade and effectively shutting down the area to incoming traffic. He worried that cars would get stuck in the mud and add to the messy situation rapidly unfolding before him.

Just across the border, Vejar could see El Paso, with its paved streets and modern infrastructure. I asked him, in effect: Why do things work so well on one side of the border, and not on the other? “I often look across and wonder why we’re so different,” he said, “because in the end, we share the same culture, the same blood, the same past. Why do things work there? Because they have rule of law?”

My colleague Angela Kocherga, who covered the drug war at its peak, once asked Leyzaola (no longer the Juárez police chief) a similar question. Leyzaola responded with a rhetorical question of his own. “How much does rule of law cost?” He answered: “About $2,” explaining that this was the price of the toll to cross the international bridge from Juárez into El Paso—where Mexicans promptly put on their seatbelts and followed the rules. Mexico has some of the toughest laws on the books—but they’re laws rarely or selectively enforced.

Photo: Three men walk along the dusty streets of Colonia Anapra in Ciudad Juárez, where lack of investment in local infrastructure has held back the economy. (Photograph by Courtney Pedroza)