Here's what you need to know about Mohammad Youssef Abdulazeez, the gunman who opened fire at two military facilities in Tenn., killing four Marines. (Alice Li/The Washington Post)

A few months before he killed five U.S. service members in a shooting rampage here, the 24-year-old gunman, who often joked that he was just an “Arabian redneck,” was smoking marijuana with friends.

It was getting late and Mohammad Youssef Abdulazeez had work the next morning at his new job some two hours away in Franklin, said a close friend who was with him that night and spent several hours with him in the days leading up to the shooting.

Abdulazeez dropped off a couple of his friends at their homes on the night in April, snorted some crushed caffeine pills and started to drive.

A little after 2 a.m., Abdulazeez was arrested for driving under the influence, according to court papers, an incident sharply at odds with blog posts in which he portrayed himself as a devout Muslim and his existence in this world a “prison of monotony and routine.”

The portrait emerging of Abdulazeez isn’t one of a committed Muslim or vengeful jihadist, but rather an aimless young man who came from a troubled home and struggled to hold down a job after college, said friends and law enforcement officials.

He never dated, the friend said.

In a statement, his family said Abdulazeez’s mental illness had contributed to the crime. “For many years, our son suffered from depression. It grieves us beyond belief to know that his pain found its expression in this heinous act of violence,” the statement said.

Abdulazeez had been in and out of treatment for his depression and frequently stopped taking his medication, despite his parents’ pleas for him to continue, said a person close to the family.

Abdulazeez smoked pot occasionally and then would feel guilty for violating his faith and beat himself up for it, said the close friend who has known Abdulazeez for 15 years and was recently questioned by the FBI. The friend, also a Muslim, spoke to The Washington Post on the condition of anonymity because he is concerned for his family’s privacy.

The friend said Abdulazeez was especially ashamed of his DUI arrest, which led to his mugshot being posted online and in Just Busted, a newspaper sold at local gas stations.

“He was pretty upset about it,” said the friend, who spoke with Abdulazeez almost daily in the weeks and days leading up to the shooting. “It was kind of degrading to him.”

The Chattanooga mosque, where the suspect in the fatal shootings of four Marines reportedly worshipped, cancelled all activities for the Muslim Eid holiday. (Reuters)

Abdulazeez’s friends said he liked to shoot guns, drive four-wheelers through the mud and hike in the mountains. Within the past year, he bought two assault rifles — an AK-74 and an AR-15 — and a Saiga 12 pistol-grip shotgun from an online weapons site. Abdulazeez and his friends would drive out to the Prentice Cooper State Forest, where they would blast away at the state park’s gun range. None of his friends thought twice about his decision to purchase military-style assault weapons.

“Take any typical Chattanoogan — Christian or Muslim — and he’s going to like to shoot guns, ride trucks and climb mountains,” the friend said.

Abdulazeez’s father was angry when he spotted one of the assault rifles in their home, and Abdulazeez hid other guns from him. “His dad was always against him having guns and said they weren’t safe to have around the house,” the friend said. Abdulazeez insisted that he was old enough to handle them responsibly.

The friend and Abdulazeez — along with two other young Muslim men — spent hundreds of hours together over the past four years, including the weeks and months leading up to the violent attack. Sometimes they talked about the Middle East’s bloody wars, such as the battles between Israel and Hamas in Gaza and the chaos in Syria.

Abdulazeez blamed some of the bloodshed on U.S. foreign policy.

“All of us are upset right now about the fighting. It wasn’t anything that would throw up red flags,” said the friend. “We never would have seen this coming at all, but especially from him. Nobody suspected a thing. If we had, we would have done something to prevent this from happening.”

Indeed, the most striking thing about the last days that Abdulazeez spent with friends is how normal they appear to have been. Two days before the shooting, he texted his friend to ask if he wanted to go hot-rodding outside Chattanooga.

“You wanna go to lookout?” he asked, referring to the mountain on the city’s outskirts.

“IDK,” the friend replied. “I might have to run a few more errands.”

“I hear ya,” Abdulazeez texted back. “Let me know.”

The two men met up later that night around 11 p.m. and took off in a Ford Mustang Abdulazeez had rented — the same car that he used in the attacks. They drove for hours around the curving mountain roads surrounding Chattanooga. “We talked and had a lot of ‘oh [expletive]’ moments,” said the friend who recalls returning home around 3 a.m. Wednesday.

On Wednesday night, the friends exchanged texts for the last time. The friend was struggling with how to balance his Muslim faith with the more secular demands of his work, which included serving bacon to customers.

Abdulazeez responded a quote from the prophet Muhammad — that speaks to the tensions in the world between believers and non-believers. “Whosoever shows enmity to a wali [friend] of Mine, then I have declared war against him,” it begins. It ends by encouraging devout Muslims to keep the faith and draw closer to God.

Although the exchange suggests Abdulazeez was devout, he often seemed to struggle with his faith. Abdulazeez was fasting for the Ramadan holiday, which requires Muslims not to eat or drink during daylight hours. But he doesn’t appear to have regularly attended his parents’ mosque in the months leading up to the shooting, according to members of the Islamic Society of Greater Chattanooga.

“The father came regularly. The mother did occasionally,” said Bassam Issa, the president of the society, which includes the mosque. “We really didn’t know much about the boy. He wasn’t around.”

Abdulazeez also struggled to find work after he graduated from the University of Tennessee at Chattanooga with an engineering degree. He briefly landed a job at a nuclear power plant in Ohio but was dismissed when he failed a background check. He told friends he had failed the company’s drug test after smoking marijuana.

He remained in Ohio, where he lived with relatives and worked for a moving company.

Back home, his family also appeared to be struggling. His mother had filed for divorce in 2009, alleging physical and sexual abuse, but later pulled the petition. In recent years, their house, in a middle-class suburb of neatly tended lawns and towering oaks, began to fall into disrepair. The home’s wooden clapboards are warped, and the gray paint is peeling. The lawn is badly overgrown.

Issa said that immediately after the shooting, Abdulazeez’s father apologized for the damage his son had done. “He was distraught,” Issa said. “His voice was broken, and he said he was very sorry for what his son caused to the community of Chattanooga and the Islamic community here.”

Issa wondered if Abdulazeez had been radicalized during his several trips to Jordan, the last in 2014 when he was in the region for seven months.

“It has to be the overseas trip that caused this,” he said. “That’s the only thing I can figure out.”

Others who knew Abdulazeez when he was a mixed-martial-arts fighter reflected on his time in the ring, searching their memory for signs of potential violence.

Chet Blalock, owner of Blalock’s International Mixed Martial Arts Gym in Fort Oglethorpe, Ga., described Abdulazeez as “very respectful” but stubbornly determined.

“My students would get him in a chokehold, and he wouldn’t tap out,” Blalock said, describing an incident in 2012. “He would just go to sleep.”

“It was a little crazy,” he added.

Less than two hours after the violent rampage, Abdulazeez’s friend texted him to check when they’d be able to meet up for the Muslim holiday of Eid. He’d seen the news alerts about the shooting in Chattanooga and wanted to talk about it with Abdulazeez, who he assumed was still at his new job outside Nashville.

By that point, Abdulazeez was already dead.