The insurgents never collected, and he returned home to become a best-selling author and a mentor to other veterans, sometimes taking them shooting at a gun range near his Texas home as a kind of therapy to salve battlefield scars, friends said. One such veteran was Eddie Ray Routh, a 25-year-old Marine who had served tours in Iraq and Haiti.

But on Saturday, far from a war zone, Mr. Routh turned on Mr. Kyle, 38, and a second man, Chad Littlefield, 35, shortly after they arrived at an exclusive shooting range near Glen Rose, Tex., about 50 miles southwest of Fort Worth, law enforcement authorities said Sunday. The officials said that for reasons that were still unclear, Mr. Routh shot and killed both men with a semiautomatic handgun before fleeing in a pickup truck belonging to Mr. Kyle.

"Chad and Chris had taken a veteran out to shoot to try to help him," said Travis Cox, a friend of Mr. Kyle's. "And they were killed."

Mr. Routh was captured a few hours later near his home in Lancaster, a southern Dallas suburb, following a brief pursuit. He will be charged with two counts of capital murder, law enforcement officials said.

Friends of Mr. Kyle's said he had been well acquainted with the difficulties soldiers face returning to civilian life, and had devoted much of his time since retiring in 2009 to helping fellow soldiers overcome the traumas of war.

"He served this country with extreme honor, but came home and was a servant leader in helping his brothers and sisters dealing with post-traumatic stress disorder," said Mr. Cox, also a former military sniper. "Everyone has their own inner struggles, but he was very proactive about the things he was dealing with."

In 2011, Mr. Kyle created the Fitco Cares Foundation to provide veterans with exercise equipment and counseling. He believed that exercise and the camaraderie of fellow veterans could help former soldiers ease into civilian life.

Mr. Kyle, who lived outside of Dallas with his wife and their two children, had his own difficulties adjusting after retiring from the Navy SEALs. He was deployed in Iraq during the worst years of the insurgency, perched in or on top of bombed-out apartment buildings with his .300 Winchester Magnum. His job was to provide "overwatch," preventing enemy fighters from ambushing Marine units.

He did not think the job would be difficult, he wrote in his book, "American Sniper: The Autobiography of the Most Lethal Sniper in U.S. Military History."

But two weeks into his time in Iraq, he found himself staring through his scope into the face of an unconventional enemy. A woman with a child standing close by had pulled a grenade from beneath her clothes as several Marines approached. He hesitated, he wrote, then shot.

"It was my duty to shoot, and I don't regret it," he wrote. "My shots saved several Americans, whose lives were clearly worth more than that woman's twisted soul."

Over time, his hesitation diminished and he became proficient at his job, credited with more than 150 kills. In his book, he describes shooting a fighter wielding a rocket launcher 2,100 yards away, a very long distance for a sniper and his farthest ever.

"Maybe the way I jerked the trigger to the right adjusted for the wind," he wrote. "Maybe gravity shifted and put that bullet right where it had to be."

"Whatever, I watched through my scope as the shot hit the Iraqi, who tumbled over the wall to the ground."

Sheriff Tommy Bryant of Erath County said investigators were still sorting out how the three men had known one another and for how long, though he said Mr. Kyle and Mr. Littlefield had been friends. The authorities said the Saturday trip was the first time the three men had been out together at that shooting range. They said they did not know the motive for the killings.

Manny Fernandez reported from Houston, and Michael Schwirtz from New York. Julie Bosman contributed reporting from New York, and Thom Shanker from Washington.