Slovakia's parliament has voted to ban controversial patrols by a far-right group on trains that targeted members of the Roma community.

Members of the People's Party-Our Slovakia (LSNS), some wearing green T-shirts and carrying weapons, have been patrolling trains since a 21-year-old woman was attacked and robbed in April.

"No one can replace the police in this country, and no one should act like it either," Justice Minister Lucia Zitnanska told the local TASR news agency.

The new law states that only law enforcement agents and train operators have the authority to impose order on train services.

There has been a recent surge in support for the anti-immigrant LSNS, with the party entering the Slovakian parliament for the first time in March following the refugee crisis.

The LSNS vowed to defy the ban, and even to extend the patrols across the country. It claims that the patrols aim to ensure public safety, however critics claim they target the Roma in racist attacks.

Roma Slovakia
A Roma neighborhood in Bystrany, eastern Slovakia Getty Images

"People in eastern Slovakia are being terrorised by asocial parasites," lawmaker Milan Mazurek in charge of the patrols said in parliamentary debate on the law.

"When the patrols are in trains, all passengers behave better, we did not have to use force so far, our presence is enough," he told Reuters.

Europe's Roma are among its poorest and most discriminated against communities, according to human rights groups.