A Milan court on Monday convicted former Italian premier Silvio Berlusconi of paying for sex with an underage prostitute during infamous “bunga bunga” parties at his villa and then using his influence to try to cover it up.

Berlusconi, 76, was sentenced to seven years in prison and barred from public office for life — a sentence that could mean the end of his two-decade political career. However, there are two more levels of appeal before the sentence would become final, a process that can take months.

Berlusconi holds no official post in the Italian government but remains influential in the uneasy cross-party coalition that emerged after inconclusive February elections.

Both he and the Moroccan woman at the center of the scandal have denied ever having sex.

His attorney, Niccolo Ghedini, immediately announced an appeal and said the sentence was as expected as it was unjust.

“This is beyond reality,” Ghedini told reporters outside the courthouse. The sentence was even stiffer than the six-year prison term and lifetime ban on public office that prosecutors originally requested.

“I’m calm because I’ve been saying for three years that this trial should never have taken place here,” Ghedini said.

The charges against the billionaire media mogul stem from the bunga bunga parties in 2010 at his mansion near Milan, where he wined and dined beautiful young women while he was premier. He says the dinner parties were elegant soirees; prosecutors say they were sex-fueled parties that women were paid to attend.

Neither Berlusconi nor the woman at the center of the case, Karima el-Mahroug, better known by her nickname Ruby, have testified in this trial. El-Mahroug was called by the defense but failed to show on a couple of occasions, delaying the trial. Berlusconi’s team eventually dropped her from the witness list.

El-Mahroug did testify in the separate trial of three Berlusconi aides charged with procuring prostitutes for the parties. She told the court that Berlusconi’s disco featured aspiring showgirls dressed as sexy nuns and nurses performing striptease acts and that one woman even dressed up as President Obama.

Berlusconi was not in court on Monday. The three female judges deliberated for more than seven hours before delivering their verdict. Their written explanations for arriving at the verdict will be submitted in the next few weeks.

Berlusconi frequently has railed against Milan prosecutors and judges, accusing them of mounting politically motivated cases against him.

Berlusconi, who has been tried numerous times relating to his business dealings, has been convicted in other cases at the trial level. But those convictions have always either been overturned on appeal or the statute of limitations has run out before Italy’s high court could have its say.

The sex-for-hire case is the first involving his personal conduct.

— Associated Press