A German court has convicted two men of sexual assault in a New Year's eve mob attack on women in Cologne which sparked outrage and hardened public opinion against Berlin's decision to allow in more than one million migrants.

The District Court of Cologne gave a 20-year-old Iraqi and a 26-year-old Algerian a one-year suspended sentence each in a ruling that came just hours after the parliament in Berlin unanimously toughened sex crime laws.

It was the first such conviction from the incidents in Cologne on New Year's Eve, when hundreds of women told police they had been groped, attacked and robbed by mobs of men outside the central train station. Police said the suspects were mainly of North African and Arab appearance.

The incidents took place as Germany wrestled with the problem of accommodating more than one million migrants last year, mostly people fleeing conflicts in Syria, Iraq and Afghanistan.

The Cologne police chief was forced to resign and women's rights activists launched the "no means no" awareness campaign after the attacks, which prompted a debate about problems arising from trying to integrate the new arrivals.

The court said the two men along with a group of 10 to 15 other men separated two victims from one another. It added that the Iraqi was found guilty of kissing one of the victims and licking her on her face against her will.

The Algerian prevented a man accompanying the victim from intervening to stop the attack and asked him if he would "abandon the girl for 5,000 euros." He was found guilty of being an accessory to the sexual assault crime.

The Iraqi man, who was 20 at the time, was sentenced under juvenile law and was ordered to take part in an integration course and serve 80 hours of community work.

In other cases related to the attacks on New Year, offenders were sentenced for theft and other minor crimes.

Earlier, the German parliament unanimously approved a new law making any form of non-consensual sexual contact a crime.

The new law seeks to reassure a public shaken by the attacks in Cologne and elsewhere, which were largely blamed on migrants.

The measures aim to close loopholes that made it difficult to punish offenders if proof that they had used violence against their victims was lacking or when victims did not resist.

Under the new rules, all forms of non-consensual sexual contact will be punishable, regardless of the circumstances.

All 601 lawmakers participating in the debate voted in favour of the new measures.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.