Ezri Namvar, the Brentwood real estate investor convicted of federal wire fraud charges, was sentenced to seven years in federal prison on Tuesday.

The sentencing was handed down by U.S. District Judge Percy Anderson in a downtown Los Angeles courtroom packed with supporters and some victims, with many audience members spilling out into the foyer.

Namvar, 60, was found guilty in May of stealing about $20 million from four clients who had given money to his Namco Financial Exchange company to facilitate a 1031 exchange, a transaction in which property sellers defer paying taxes by parking proceeds with an intermediary until they find another property to buy.

However, that loss was just a fraction of the hundreds of millions of dollars he is believed to have bilked out of investors who poured money into his $2.5 billion real estate portfolio before it collapsed in the 2008 market crash. Many of the hundreds of investors were fellow Jewish refugees from Iran who lived in Beverly Hills and its environs. Namvar did not face criminal charges for those losses, which are still being handled in bankruptcy court.

The judge described Namvar, who wept at times, as a man who lost his way after immigrating and building a successful business empire “from the ground up.”

“I think he lost his moral compass, and the courage to stand up and admit when you’re wrong,” Anderson said.

The judge also sentenced Namvar to three years of supervised release following his prison term, and ordered him to pay restitution of more than $20 million to the 1031 exchange victims. The term is scheduled to start Nov. 8, though Namvar will be allowed to apply for a two week delay.

Prosecutors had asked for 10 years in prison, and federal sentencing guidelines suggested a sentence of 8 ½- to 11 1/2years. Anderson cited Namvar’s lack of criminal history and dozens of letters attesting to his good character as reasons for a lesser term.

Two of the 1031 exchange victims spoke before Tuesday’s sentencing. One called him a “liar and a thief,” saying that she and her husband had lost their retirement savings.