ROSEBURG, Ore. — The gunman who killed nine people on a college campus set out on his rampage armed with six guns, a flak jacket and enough ammunition to do far more damage — an angry, isolated young man whose rage was fueled by animus toward religion and resentment at how his life was unfolding, law enforcement officials said Friday.

At the scene of the carnage, on the campus of Umpqua Community College, investigators found a typed statement several pages long, written by the gunman, who died there in a shootout with the police, describing his life as a deck of cards stacked against him. He was a student at the college and was enrolled in the writing class he targeted, local authorities said on Friday.

“He didn’t have a girlfriend, and he was upset about that,” said a senior law enforcement official, who spoke on condition of anonymity because he was not authorized to discuss the matter publicly. “He comes across thinking of himself as a loser. He did not like his lot in life, and it seemed like nothing was going right for him.”