Sgt. First Class Elis A. Barreto Ortiz navigated the crowded streets of Kabul, Afghanistan, on Thursday morning unaware that the United States was on the verge of a precarious peace deal with the Taliban that might end the longest war in American history — just as he was unaware that a suicide bomber hidden in the chaotic city traffic could upend the deal by aiming a car laden with explosives at the sergeant’s truck.

But as Sergeant Barreto Ortiz, who was part of a driving team for covert special operations officers, neared a checkpoint in the neighborhood where Afghan national security authorities have offices, his unarmored Toyota SUV — meant to blend in with civilian traffic — was hit by a suicide car bomber. The explosion killed the sergeant, a Romanian army corporal and 10 Afghan civilians. The Taliban almost immediately claimed responsibility.

Later that day, President Trump told his national security team he would not host talks with the Taliban immediately after the group had killed an American soldier, saying, “This is off; we can’t do this.”

Those who knew Sergeant Barreto Ortiz, 34, who was on his third deployment in Afghanistan, described him as a compassionate leader whose two loves were his family and the Army. They said on Monday that he gave little thought to the broad strategic posturing of top leaders and instead focused on caring for the people around him.

He grew up in a small town in Puerto Rico, the son of a career Army soldier, and joined the Army himself in 2010. He lived with his wife and two sons near Fort Bragg in North Carolina, where the 82nd Airborne Division is based.

“His father served with pride, and he always wanted to be just like him,” his wife, Legna Aponte, said. “He loved his country, and for him it was an honor to serve.”

Sergeant Barreto Ortiz was trained as a wheeled-vehicle mechanic, and his family moved often once he enlisted, living at bases in Virginia, Germany, Kansas and North Carolina. But wherever he has stationed, the sergeant’s effusive smile, fundamental kindness and good-natured trash talking quickly made scores of friends.

“He was a truly positive, great person,” said Sgt. Tylar Sieck, a fellow mechanic and close friend. “He would tell us what to do, and we’d have to do it, but he would make it enjoyable. Because he did the best he could and took pride in it, it made things more enjoyable for all of us.”

He called his soldiers pappi, and many soon felt comfortable enough around him to call him the same.

Serving in the 82nd Airborne, Sergeant Barreto Ortiz had to be as skilled at jumping out of planes as he was at fixing trucks. In his spare time, he liked to race his Acura RSX, or pull it into the garage and have his sons help him soup it up.

The sergeant deployed to Kabul most recently in June, and was assigned to a team of drivers for high-ranking Naval Special Warfare troops, Sergeant Sieck said.

That meant spending days navigating the hectic avenues between American and Afghan bases. Sergeant Barreto Ortiz once sent Sergeant Sieck photos of his unarmored Toyota sitting in tangled Kabul traffic.

“Dude, that looks like a suicide bomber could take you out there,” Sergeant Sieck texted him.

“I know,” Sergeant Sieck said Sergeant Barreto Ortiz texted back.

On a previous deployment Sergeant Barreto Ortiz’s platoon had been hit by enemy fire, his wife said, and he spoke openly about the dangers of his job and the possibility of his death.

“We would talk about what to do if he didn’t come back,” she said. “He would say, ‘Don’t be sad for me, be proud.’ That is why I’m destroyed — my heart breaks, but I want to be strong. Because he was doing what he loved.”

For nearly a year, the United States has been negotiating a peace deal with the Taliban that would lead to the gradual withdrawal of all 14,000 United States troops and a possible end to a war that has cost the lives of tens of thousands of Afghans and more than 3,500 American and coalition soldiers.

Image

Sergeant Barreto Ortiz’s remains were moved past Secretary of State Mike Pompeo at Dover Air Force Base on Saturday.CreditCliff Owen/Associated Press

As talks continued, so did hostilities. There have been 16 American combat fatalities in Afghanistan this year, and the Taliban have pursued a ruthless campaign of attacks on Afghan forces and civilians.

Last week a deal was reached that would have begun the withdrawal in exchange for the Taliban’s assurances that they would not harbor terrorists, but as the White House, the Taliban and the Afghan government drew closer to signing, fissures appeared in the agreement.

The killing of Sergeant Barreto Ortiz was enough to topple the deal, at least for now.

“I don’t know what he would have thought about that,” Sergeant Sieck said. “Honestly, soldiers don’t really talk about our opinions of why we’re over there. Regardless of how we feel, we’re not going to change it. You do your job and make the best of it.”

Dave Philipps covers veterans and the military, and is a winner of the Pulitzer Prize for National Reporting. Since joining the Times in 2014, he has covered the military community from the ground up. @David_Philipps•Facebook

A version of this article appears in print on , Section A, Page 15 of the New York edition with the headline: Soldier Whose Death in Afghanistan Upended Peace Talks ‘Loved His Country’. Order Reprints | Today’s Paper | Subscribe