The offence, newly introduced after Russia's Feb. 24 invasion of Ukraine, carries a prison sentence of up to five years.
Russia calls its actions in Ukraine a "special military operation" and people risk prosecution if they use the words "war" or "invasion".
Roizman was greeted in the court building by supporters, who shouted "Freedom". He thanked them for coming as he was escorted into court in handcuffs.
Roizman's case centers on a Q&A session held on YouTube, according to the prosecution, which asked the judge to impose a number of restrictions on the former mayor, including on leaving his home and using the internet.
Roizman's former lawyer, speaking outside the court before the hearing, said the case was "politically motivated".
The Sun newspaper brings you the latest breaking news videos and explainers from the UK and around the world
Become a Sun Subscriber and hit the bell to be the first to know
Read The Sun: www.thesun.co.uk
Like The Sun on Facebook: www.facebook.com/thesun/
Follow The Sun on Twitter: twitter.com/TheSun
Subscribe to The Sun on Snapchat: www.snapchat.com/discover/The_Sun/1633225139