The mastermind behind the nationwide college admissions bribery scheme that ensnared celebrities, prominent businesspeople and other parents who used their wealth and privilege to buy their children’s way into top-tier schools was sentenced to 3½ years in prison Wednesday.

The punishment for Rick Singer, 62, is the longest sentence handed down in the sprawling scandal that embarrassed some of the nation’s most prestigious universities and put a spotlight on the secretive admissions system already seen as rigged in favor of the rich.

Prosecutors had sought six years behind bars, while noting Singer’s extensive cooperation that helped authorities unravel the entire scheme. Singer began secretly working with investigators in 2018 and recorded hundreds of phone calls and meetings that helped authorities build the case against dozens of parents, athletic coaches and others arrested in March 2019.

Those sent to prison for participating in the scheme include “Full House” actor Lori Loughlin, her fashion designer husband Mossimo Giannulli, and “Desperate Housewives” star Felicity Huffman. Coaches from schools including Yale, Stanford, Georgetown and the University of California-Los Angeles admitted to accepting bribes.

“It was a scheme that was breathtaking in its scale and its audacity. It has literally become the stuff of books and made-for-TV movies,” Assistant U.S. Attorney Stephen Frank told the judge Wednesday.

The prosecutor called Singer’s cooperation in the case unparalleled but said it was also problematic, noting that Singer admitted to obstructing the investigation by tipping off several of his clients who were under government scrutiny.

Defense attorney Candice Fields said Singer took great personal risk by wearing a wire to record meetings and “did whatever was necessary” to assist the government in its investigation. Fields had requested three years of probation, or if the judge deemed prison time necessary, six months behind bars.

Singer apologized to his family, the schools he embarrassed in the public eye and others. He also promised to work every day of his life going forward to make a positive impact in people’s lives.

Singer pleaded guilty in 2019 — on the same day the massive case became public — to charges including racketeering conspiracy and money laundering conspiracy. Dozens of others ultimately pleaded guilty to charges, while two parents were convicted at trial.

Authorities in Boston began investigating the scheme after an executive under scrutiny for an unrelated securities fraud scheme told investigators that a Yale soccer coach had offered to help his daughter get into the school in exchange for cash. The Yale coach led authorities to Singer, whose cooperation unraveled the entire scheme.

Singer took in more than $25 million from his clients, paid bribes totaling more than $7 million, and used more than $15 million of his clients’ money for his own benefit, according to prosecutors.

Before Singer, the toughest punishment had gone to former Georgetown tennis coach Gordon Ernst, who got 2½ years in prison for pocketing more than $3 million in bribes.

Punishments for the parents have ranged from probation to 15 months behind bars, although the parent who received that prison sentence remains free while he appeals his conviction.