Russian opposition leader Aleksei Navalny was released from police custody on Sunday after being detained for several hours the day before on charges of organising an unauthorised demonstration in Moscow against President Vladimir Putin.

Navalny posted on his Twitter account that he was released before his trial and that he left the Russian capital’s police headquarters after midnight, reports Efe news.

The opposition leader was arrested on Saturday in central Moscow when he attended a protest under the slogan “He is not our tsar”, which he himself had called for on the eve of Putin’s swearing in for his new term in office.

Thousands of people attended rallies on Saturday called by Navalny, in downtown Moscow and in St. Petersburg, the two largest cities in the country, despite warnings from municipal authorities.

More than 1,200 people were arrested all over Russia.

Smaller demonstrations were held in close to 100 cities, although the police only acted against protesters where the marches had not been authorized by local authorities.

Arrests were reported in Chelyabinsk, Krasnoyarsk, Yakutsk, Novokuznetsk, Kemerovo, Yekaterinburg, Penza, Tver, Voronezh, as well as a dozen other cities

Navalny, the most vocal opponent of the Kremlin, campaigned for the presidential elections on March 18 but was unable to attend the elections because of his criminal record in a case he considers a political persecution.