The German parliament has passed a radical overhaul of the country’s rape laws, considerably broadening the definition of sex crimes in light of the assaults carried out in Cologne on New Year’s Eve.

The legislation tightens the rules on consent and makes it easier to deport foreign nationals who are convicted of committing sex crimes.

German rape laws have long been considered antiquated, particularly when compared with those of the rest of Europe. Victims are currently required to show that they physically resisted attack before charges for rape and other sexual assaults can be brought.

Under the new law, based on the tenet “no means no” or “nein heißt nein”, a victim who verbally expressed their refusal to give consent would be able to file a criminal complaint.

The legislation makes groping a sex crime and enables the prosecution of entire groups, in an attempt to address the events of Cologne.

“In the past there were cases where women were raped but the perpetrators couldn’t be punished,” said Germany’s minister for women, Manuela Schwesig.

“The change in the law will help increase the number of victims who choose to press charges, lower the number of criminal prosecutions that are shelved and ensure sexual assaults are properly punished.”

An estimated 1,000 women reported having been sexually assaulted by men operating in a seemingly coordinated way at Cologne’s main train station on New Year’s Eve.

There were widespread accounts of women being cornered by men who tried to disorientate them by spinning them around, separating them from friends and families, and then robbing them and verbally and physically assaulting them, often in a sexually humiliating manner.

The attacks, which deeply shocked Germany, were mostly blamed on men of Arab and north African origin.

The subsequent admission by the city’s police that most of the attackers would probably never be caught sparked outrage. It also fuelled the debate about Germany’s willingness to accept a record number of refugees and migrants last year.

A rethink of rape legislation was triggered, and the justice minister, Heiko Maas, said the law had “unacceptable gaps in protection” and had to be changed to cover “the real situations in which most attacks occur”.

On Thursday, the “no means no” clause was passed unanimously in the Bundestag, with all parliamentarians from the coalition government and the opposition voting in favour of it.

But the Greens and leftwing Linke abstained from voting for parts of the new legislation because of objections to a clause that will make it illegal to be in a group that commits assaults in a crowd.

The Green party had previously said it was unconstitutional to convict an entire group for rape. “No one should be convicted for a sexual crime that he himself did not commit,” said Renate Künast, the head of the Bundestag’s legal committee.

The Linke condemned the ease with which authorities will be able to deport some perpetrators considered to “pose a danger to the general public”, possibly to face persecution in their homelands. Whilst welcoming some aspects of the reformed law, Cornelia Möhring, of the Linke, said: “The success is accompanied by a bitter aftertaste, which indulges a post-Cologne populism.”

Campaign groups had been calling for an overhaul of the law for years but faced tough opposition, largely from Angela Merkel’s Christian Democrats.

Following the Cologne attacks the changes were rapidly applied.

Elke Ferner, chair of the working group of Social Democratic women, said incidents in Cologne had “given the draft bill a fortunate momentum, even if it was triggered by a terrible event”.

The law is not expected to come into force until the autumn, despite pressure for a speedier process. Having been passed by the Bundestag, it then has to go to the upper house, the Bundesrat, which will vote on it after the summer recess.