A Hezbollah “sleeper” agent blasted the US government as ethically bankrupt Tuesday — before he was sentenced to 40 years behind bars for his role in the terrorist organization.

Ali Kourani told a Manhattan federal courtroom that prosecutors “violated all ethics” after he appeared on their doorstep volunteering information about Hezbollah — and was then charged for providing material support as a member of the Islamic Jihad Organization.

“I wonder what will be next?” the former Bronx resident hypothetically asked judge Alvin Hellerstein. “Dismembering dissidents in embassies? Turning sanctuary cities into black sites?”

Kourani’s conviction and sentence as a member of IJO is the first of its kind in the country, with a jury finding him guilty of spying on Hezbollah’s behalf between 2002 and 2015.

The 35-year-old, who referred to himself as “the child of a war,” was born in Lebanon but immigrated legally to the US in 2003 before settling in New York City where he surveilled Big Apple airports, federal buildings and military facilities — and sent reports back to higher-ups. Prosecutors claim he fraudulently obtained citizenship in order to participate in IJO attack-planning missions.

During his Tuesday statement, the former counterfeit Ugg salesman failed to express any remorse for his actions or affiliation with Hezbollah — which is considered a terrorism organization by the United States — and instead called it a “political party” as he continued to rail against “government overreach” and America’s “double standards.”

Hellerstein eventually intervened, interrupting Kourani’s monologue about his broken family to remind him he’d been convicted by a jury.

“It was not the government, the prosecutors, the CIA… who found you guilty,” the judge barked. “You can’t blame the government because you’re estranged from your wife and she divorced you and took the kids to Canada.”

Meanwhile, Assistant US Attorney Emil Bove asked Hellerstein to sentence Kourani to 110 years in prison, saying he needed to send a robust message to the IJO.

“This is a unique case,” Bove said as he encouraged a maximum sentence. “Your voice will be heard today in Lebanon by Hezbollah, your voice will be heard today by the leaders in Iran, who are directing IJO operatives.”

While sentencing guidelines recommended anywhere from 30 years to life sentence, the judge ultimately handed down 40 years, saying a sentence of that length would “create a condition where his useful life is spent in prison.”

Kourani will be deported following the completion of his sentence.

Defense attorney Alexei Schacht said he planned to appeal.