ROME — An appeals court in Milan upheld a conviction on Wednesday of former Prime Minister Silvio Berlusconi for tax fraud, sentencing him to four years in prison and imposing a five-year ban on holding public office.

The ruling was a blow for Mr. Berlusconi, the leader of Italy’s main center-right party, which recently formed a grand coalition government with its main political opponent, the Democratic Party.

If upheld by the Court of Cassation, the final arbiter, the ruling would mean that Mr. Berlusconi would lose his seat in Parliament, one of his lawyers said Wednesday.

Italy’s highest court, which rules on questions of legal procedures, could hear the case as early as this year, the lawyer said. Even if Mr. Berlusconi, 76, were definitively convicted, he would be unlikely to go to prison because of his age.