ROME — Rome’s embattled mayor was acquitted on Saturday of charges of lying about a city hall appointment, a case that threatened her career as well as the credibility of the anti-establishment Five Star Movement she represents.

A judge found that no crime had been committed when the mayor, Virginia Raggi, appointed the brother of her top aide to a prestigious tourism position at the beginning of her tenure in 2016.

“This sentence wipes away two years of political mud,” Ms. Raggi told reporters outside Rome’s court. “I am going ahead with our heads high for Rome, my beloved city, and all residents.”

Prosecutors had sought a 10-month prison term on charges that Ms. Raggi had lied to anti-corruption officials when they questioned her about the appointment. Ms. Raggi said that the choice was hers alone, while prosecutors argued that it had been orchestrated by her aide.