A trainee lawyer was kicked out of a courtroom in Italy's Bologna for wearing the Muslim headscarf, reports said Thursday, in a ruling reversed after a day of strong criticism.

The 25-year-old Muslim woman identified as Asmae Belfakir, who attended the hearing as a trainee lawyer, was told by the judge to take off her headscarf or leave the courtroom at the Emilia-Romagna regional administrative court (TAR).

The Moroccan-born woman refused to take off her headscarf and chose to leave the hearing.

After the action stirred criticism from several legal and community groups, the decision was reversed Wednesday evening.

The Bologna TAR president said later in the day Belfakir could return to the court wearing her headscarf, "without problems."

Having completed a law degree at the University of Modena and Reggio Emilia, Belfakir was chosen as a trainee by the legal office of the university.

Speaking to Italian media outlets, Belfakir said that she's never experienced anything like this before and had attended hearings at the regional and state courts wearing the religious garment.

The Organization of Young Italian Lawyers opposed the judge's action, saying that it is against constitutional principles and expressed solidarity with the Muslim woman.

The Muslim community coordinator of Bologna Yassine Lafram noted that there are no laws prohibiting the headscarf in courtrooms, adding that the judge adopted an "arbitrary position."

Social media users also condemned the judge for telling the Muslim woman to leave the hearing.