TAMPA — The victims were American cops — agents with Immigration and Customs Enforcement on assignment in Mexico. They'd been ambushed by hit men working for a Mexican drug cartel. One agent was wounded. The other, Jaime Zapata, was killed.

As prosecutors prepared to put the killers on trial in 2017, it fell to Maria Chapa Lopez, a Justice Department diplomat stationed in Mexico City, to track down witnesses and evidence.

She didn't try the case herself. But her behind-the-scenes work helped secure convictions in what was dubbed "Operation Fallen Heroes."

Few cases better illustrate the professional drive of Chapa Lopez — an Army veteran, daughter of Mexican immigrants and a career law enforcer.

This week, the U.S. Senate confirmed her to be the U.S. Attorney for the Middle District of Florida. The confirmation makes her the top federal prosecutor for the Tampa-based district, which includes 35 Florida counties, from Jacksonville to Naples.

The appointment is the pinnacle of a legal career that has put her on the front lines prosecuting international drug traffickers, large-scale money laundering operations, and complex opioid cases.

•••

Lopez was born in Chicago, eldest of five children born to Mexican immigrants. Her father was an auto mechanic who sought a better life in the United States, returning to Mexico to marry her mother. He later became a U.S. citizen.

She credits her parents with instilling her with an appreciation of her cultural heritage and a deep sense of American patriotism.

"I love my Mexican roots," she said in a recent interview. "But I'm an American. I love this country."

The family later moved to Odessa, Texas, where she spent much of her youth. She remembers a speech teacher at Periman High School who noticed her capacity for argument. He encouraged her pursuit of a career in law.

She went to college at the University of Texas-Austin, earning a degree in political science in 1980. She later attended law school at the South Texas College of Law. Among the school's alumni are dozens of Tampa lawyers and judges, many of them proteges of former state attorney and appellate judge E.J. Salcines.

Today, Chapa Lopez considers Salcines a mentor. But her route to Tampa was circuitous.

"If I had planned to end up here, it wouldn't have happened," she said.

She joined the Army, lured by the opportunity head straight into the courtroom as part of the Judge Advocate General's Corps after completing law school. In JAG, she gained experience as a prosecutor and defense attorney. She also represented the Army in civil cases. She rose to rank of lieutenant colonel.

In 2000, while stationed in Fort Stewart, Ga., her name came to the attention of then-U.S. Attorney Donna Bucella, who invited her to be a prosecutor in Tampa.

That began her tenure as an assistant U.S. attorney, where she honed her focus on complex drug cases. In her 16 years in Tampa, Chapa Lopez had a hand in more than 80 jury trials.

"She realizes that defendants are human beings," Bucella said. "She understands that people make bad decisions. Sometimes horrific decisions."

Among her most complicated and best-known cases was the 2007 trial of Joaquin Mario Valencia-Trujillo, a Colombian drug lord who headed the now-defunct Cali cartel.

In 2016, she was hired as the Department of Justice deputy attache to the U.S. Embassy in Mexico City — a post that serves as a bridge between U.S. prosecutors and Mexican law enforcement in international criminal cases.

It was there she became involved in the probe into Zapata's murder.

Her duties included interviewing the Mexican police chief who was the first to respond after the ICE agents were attacked. She also located the guns used and obtained a Mexican judge's permission to send them to the United States for forensic testing.

"That was probably one of the most righteous cases I've participated in," she said.

•••

Former U.S. Attorney A. Lee Bentley III resigned in March 2017, one of 46 top prosecutors nationwide appointed by President Barack Obama who were asked to leave.

For months it remained unclear who would succeed him. The Justice Department chose to forego a formal search for candidates, typically done through interviews with the federal Judicial Nominating Commission.

Chapa Lopez sent her resume to U.S. Senator Marco Rubio and followed up with a face-to-face visit. Last October, she interviewed with Attorney General Jeff Sessions and Deputy Attorney General Rod Rosenstein.

Sessions appointed her interim U.S. Attorney in January. President Donald Trump formally nominated her in May.

Asked if she has any misgivings about the administration's approach to immigration issues, Chapa Lopez said only that she can't let her views interfere with her work.

"As the top prosecutor in this federal district, whatever personal feelings I have, I have to set them aside," she said. "I have to enforce the law."

Contact Dan Sullivan at dsullivan@tampabay.com or (813) 226-3386. Follow @TimesDan.