OAKLAND — A former Nevada resident who authorities say was caught illegally trafficking dozens of guns across state lines to the Bay Area was sentenced last week to eight years in federal prison, court records show.

Anthony Reed, 23, was one of five Nevada and California residents indicted in November on charges of conspiring to sell guns, and brandishing a gun in the commission of a violent crime. Prosecutors say Reed and his co-defendants sold 35 guns to a man who, unbeknownst to them, was an undercover agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives.

The case reached its peak when Reed and the others conspired to rob the undercover agent, luring him to a purported gun transaction. When the agent showed up, co-defendants James Medeiros, 25, of San Leandro, and Marcos Antonio Martenez, 25, of Oakland, took $8,000 in cash from him at gunpoint.

Medeiros, Reed, and Jesus Angel Sanchez, 20, of Oakland, were arrested leaving the scene of the robbery. Martenez was arrested days later, prosecutors said. Authorities later identified Benjamin Gormley, Julaan “Juju” Faison, and Rahsaan “SG” Faison as being involved in the gun trafficking conspiracy.

“This conduct was extremely serious: in fact, two of (Reed’s) co-conspirators pointed guns at the victim from at most a few feet away, while stealing from the victim,” assistant U.S. Attorney Samantha Schott wrote in a sentencing memo. “Other than murder, there can be no more dangerous a crime, as in brandishing the firearm, the defendant’s coconspirators endangered the life of the victim as well as every individual present.”

According to federal authorities, Reed would acquire guns in the Las Vegas area, where he lived, then either personally take them to the Bay Area or recruit co-conspirators to do so. He advertised guns on the popular social media application Snapchat, and authorities believe he was involved in other gun deals beyond the ones to the undercover agent.

“While his criminal history is limited, (Reed) flooded the community with guns over the course of at least eight months,” Schott wrote. “The defendant was intimately aware of the danger and horrors of gun violence, yet he repeatedly trafficked firearms into Alameda County and provided them for sale to individuals who were prohibited from legally obtaining firearms.”

Both prosecutors and defense attorneys agreed to the eight-year sentence. Reed’s attorney, K. Alexandra McClure, wrote in a sentencing memo that Reed turned to illegal activities in part due to a traumatic childhood, but was ready to give up a life of crime and aspired to open his own barber shop after his release from prison.

“(Reed) is committed to dealing with his past trauma and addiction that plagued him during his offense conduct in order to prevent himself from repeating his mistakes,” McClure wrote. “He recognizes the benefit and need for treatment. Importantly, his love of his family, friends and young cousins who admire him inspires him to do better. He does not want to let them down again.”

Besides Reed, Gormley was sentenced to three years probation, while Martenez and Medeiros were each given seven-year terms. The remaining defendants are still waiting resolution in their cases, according to court records.