By the time 24-year-old Benjamin Colton Barnes fled into the woods in Mount Rainier National Park, suspected of the ambush-style slaying of a park ranger, friends say his life already had collapsed around him.

Records show he’d struggled in high school and had been kicked out of his beloved Army — a loss that fed an obsession with guns, according to one acquaintance.

He lost his girlfriend to his erratic, threatening behavior and a close Army friend to suicide. He was under court order to be supervised when he visited his infant daughter.

In recent months, he’d lost his apartment and his job, friends said. He started sleeping in his car in casino parking lots.

Then early Sunday morning, his role in a gunfight that left four people wounded at a Skyway home sent him running for the mountains, the place a friend says he felt most at home.

Barnes had contacted his family after the 3 a.m. Skyway shootings, which started with a dispute over a firearm, according to the King County Sheriff’s Office.

Investigators said they had been working with Barnes’ relatives in hopes of persuading him to surrender even as his blue Pontiac sedan roared through a chain-up checkpoint just inside the park.

Park Ranger Margaret Anderson knew none of this as she set up a roadblock to intercept Barnes’ car.

Barnes stopped, according to witnesses, and then stepped out of the car and shot the 34-year-old mother of two girls, ages 3 and 1. Police say he fired on another ranger, who wasn’t injured, and then on a Pierce County SWAT unit that was trying to render aid to Anderson.

Barnes, armed with at least a rifle, handgun, spare ammunition and knife, then fled into deep snow and heavy forest.

Anderson, who was married to another park ranger, Eric Anderson, died from gunshot wounds to her head and torso.

Barnes was found dead Monday, his body partly submerged in Paradise Creek. He was wearing one tennis shoe, jeans and a T-shirt. An autopsy showed he drowned, with hypothermia contributing to his death, the Pierce County Medical Examiner’s Office said Tuesday.

Mount Rainier National Park will remain closed until Saturday while the FBI concludes its investigation, the National Park Service said. Employees attended a staff meeting Tuesday to help them deal with Anderson’s death. She is the first ranger to be killed at the park.

Barnes enlisted in the Army in 2007 and was stationed at Joint Base Lewis-McChord, but even then he was a bit of a loner, say those who knew him. He wandered into a car-stereo shop one day in Lakewood and told employees he didn’t have any friends.

He lived in the barracks but started hanging out at the shop — at least until he was deployed.

Barnes spent two years and seven months in the service, including a tour in Iraq, one of more than 3,500 soldiers with the 4th Brigade, 2nd Infantry Division, which was part of an influx of troops into Diyala province that sought to contain insurgent forces in the city of Baquba. But he was discharged from the Army in 2009 after an arrest for driving under the influence and illegal transportation of a private weapon.

Many soldiers spent much of their time outside of major fortified U.S. bases in smaller outposts shared with Iraqi troops, according to Christopher Williams, a former sergeant who served in Iraq with the brigade.

Army records state that Barnes was assigned to a headquarters unit, a job that typically involves installing, maintaining and troubleshooting communications equipment.

Barnes’ military records make no mention of him receiving a Combat Action Badge, typically awarded to soldiers who come under fire, according to Maj. Chris Ophardt, a spokesman at Joint Base Lewis-McChord.

Barnes’ Facebook profile contains a photograph of him in full battle dress carrying an M4 rifle, posing in front of what appears to be a group of Iraqi men. It also notes that his father was a Marine and that he has a brother who served in Afghanistan.

His family, which lives in rural Riverside County in Southern California, has declined to comment.

About two months ago, Barnes attended the burial in a Riverside-area military cemetery of a close friend and Army soldier who committed suicide, according to Chris Smith, a friend of both men. The soldier, who was 24 and married with a young daughter, died in October, according to a website obituary.

Barnes “was pretty darn heartbroken,” Smith, also 24, said in a telephone interview. “He was on the verge of dropping tears.”

He didn’t know if Barnes and the soldier served together in Iraq.

Smith said he and Barnes attended the same middle school and Jurupa Valley High School in Mira Loma, near Riverside.

Barnes was likable and “pretty quiet,” but did not participate in school activities, Smith said.

Records kept by the Jurupa Unified School District show Barnes had been enrolled in the STEPS program, a community day school for expelled and troubled students, district Superintendent Elliott Duchon told the Press-Enterprise newspaper in Riverside. Court records indicate he earned a GED.

Smith said he had heard through friends that Barnes had become obsessed with guns after leaving the military. “Everything was guns and shooting and stuff like that,” Smith said.

The friends he’d fallen in with at the car stereo shop in Lakewood said Barnes did like to shoot. But he also hit clubs and the gym and spent as much time as he could camping and fishing in and around Rainier and with his daughter.

But the collapse of his relationship with his daughter’s mother last summer seemed to touch off a spiral. His ex-girlfriend said he once pulled a knife on her and had threatened suicide, according to court records.

Barnes drank too much and seemed moody. He told people he had bad dreams. He complained about not having enough money.

“When I first met him he was very respectful, a good guy,” said Junior Juarez, 22, who said he considered Barnes his best friend. “But everything just got to him. Life got so hard. He was so stressed. He would say, ‘I feel like nobody’s trying to help me. I feel like everybody’s against me.’ “

Another friend, Lucio Garcia, said, “He was going through a lot. He didn’t even have a roof over his head.”

Juarez said he tried to help, inviting Barnes to stay at his house, but he refused.

“He just kept telling me how bad he felt, especially about his baby,” Juarez said.

They last spoke on New Year’s Eve. Juarez invited him to a party near Tacoma. Barnes declined.

What happened next, Juarez said he still can’t process.

“I don’t understand it,” Juarez said.

Seattle Times staff reporter Hal Bernton and news researcher David Turim contributed to this report.