He was Phi Beta Kappa at Georgetown, a top economics student and an award-winning debater. He won a scholarship to study at the University of California, Berkeley and returned to Washington for law school, dazzling professors and helping inmates at the D.C. jail.

But Marc Gersen was leading a second, secret life that his teachers and old friends knew nothing about. He was selling methamphetamine through a sophisticated social-networking scheme, putting a future of great promise at risk.

Gersen, 31, was sentenced in federal court Thursday to four years in prison after pleading guilty to selling wholesale quantities of methamphetamine. But the punishment for his role in a drug ring that has led to the prosecution of at least three other people will last much longer for a young man who once dreamed of becoming a public defender.

Gersen has been locked up in the D.C. jail since his arrest more than a year ago outside a boutique hotel in Northwest Washington. At the time, he was a Georgetown second-year law student with a 3.48 grade-point average and an apartment in Dupont Circle. But he was also struggling with an addiction to the drug he was selling.

U.S. District Judge Reggie B. Walton’s most pressing question during the sentencing was how someone with so much opportunity could throw it all away.

Yearbook photo of Marc Gersen, a second-year Georgetown law student who was arrested for selling methamphetamine outside a boutique hotel in Northwest Washington. (Courtesy of Georgetown's Ye Domesday Book, Vol. 90 )

“Somebody as intelligent as you are had to have known,” Walton said of the dangers of the highly addictive drug. “It’s just perplexing.”

Standing at the courtroom lectern in a jail-issued orange jumpsuit, Gersen engaged in an unusually lengthy dialogue with the judge, sounding philosophical as he reflected on and took responsibility for his troubles. He was using the drugs to feel more carefree and have fun, he said. But his drug operation ultimately had the opposite result, leaving him increasingly anxious about the possibility of landing in the very spot where he stood Thursday.

When pressed by Walton, a former associate U.S. “drug czar,” about how he could trust that Gersen would not relapse after completing his sentence, Gersen responded: “How can you or I be sure that things won’t change in the future?”

“I can’t tell you that temptations won’t come,” he said. “But when they do, I will do what I need to do to make sure I stay on the right path.”

Two conflicting portraits of Gersen emerge in court documents. Letters to the judge from former classmates, law school officials, family and a campus rabbi describe Gersen’s deep passion for the law and social justice.

“His law school performance — remarkable under any circumstances — is truly incredible given the other things going on in his life,” wrote Gersen’s law professor, Louis Michael Seidman, who sat with Gersen’s mother in the courtroom Thursday. “The short of it is that Marc is an extraordinary young man who has made some extraordinary mistakes.”

At the D.C. jail, Gersen lectures fellow inmates on composition and punctuation in his popular writing class, offers legal guidance in the jail’s law library and tutors students seeking their general education diplomas. He has been reading Dostoyevsky’s “The Brothers Karamazov” as part of an intensive reading program to improve his mind and to better understand his motivations, his professor said.

But that image is hard to reconcile, prosecutors said, with the dealer who sold drugs not just to support his own addiction and who “bragged of his success in doing so.”

“What emerges from accounts of his fellow drug dealers, his customers and his own words, is of a drug dealer who believed that because of his intellectual ability, he was able to outwit law enforcement and avoid detection,” wrote Assistant U.S. Attorneys Magdelena Acevedo and Patricia Stewart.

Growing up in Florida, Gersen stood out in Advanced Placement economics even among his classmates at a public school for gifted students in Sarasota. At Georgetown, he was a member of the prestigious Philodemic Debate Society and voted best extemporaneous speaker at a homecoming debate.

It was not until graduate school at Berkeley, according to his attorney Nikki Lotze, that Gersen became addicted to and later began selling methamphetamine. He earned a master’s degree in economics but had trouble with his dissertation, according to his parents, and eventually dropped out of his doctoral program.

“Marc had never failed at anything academic before, and had an emotional breakdown,” his parents Robin and Lenny Gersen wrote in a letter to the judge. “I tried to reach out to him, but Marc didn’t talk to us about his problems until it was too late. . . . He had already gotten involved with drugs. Our family has not been the same since.”

Gersen’s arrest in December 2011 was not his first. He pleaded no contest to felony possession of the drug ecstasy in California in 2009. He was charged by San Francisco police in 2010 with drug possession.

The next year, in law school, the activity intensified and so did his addiction. Prosecutors say Gersen traveled to California several times to purchase methamphetamine that he then shipped to the District to supply his associates. He and his associates, according to court records, sold to customers they met online and through social contacts.

During Thanksgiving break in Florida, Gersen learned that the D.C. police had searched the 18th Street apartment he shared with his then-roommate and co-conspirator, Michael Talon, who has also pleaded guilty and awaits sentencing in April. Officers, acting on a tip, found small amounts of methamphetamine, packaging materials and chemicals used to manufacture the drug GHB, according to court documents.

Back in Washington on Nov. 30, Gersen removed $70,000 in cash from a safe-deposit box and transferred it to his mother. Gersen acknowledged in his plea agreement that the cash came from the drug-trafficking operation, and he has agreed to pay the government $120,000.

The next day, police responded to a tip that three of Gersen’s associates were meeting at the Beacon Hotel on Rhode Island Avenue. He was stopped and arrested as he walked toward the hotel, where police had found more than 500 grams of methamphetamine.

In court Thursday, Gersen’s father pumped his fist in the air when the judge agreed to recommend that his son serve time near his family at a prison camp in Miami.

Gersen’s felony conviction will make it more difficult, if not impossible, for him to pursue his hopes of practicing law. If he completes a drug treatment program, he could be out of prison as soon as 2014.

Staff writer Michael DeBonis contributed to this report.