BERLIN (Reuters) - German police have detained an Iraqi migrant for suspected rape only days after an Afghan refugee was held in a separate rape and murder case, and the government warned against a political backlash to such crimes.

The two cases threaten to fan anti-migrant sentiment in Germany, which saw a record 890,000 people from the Middle East, Africa and elsewhere arrive last year. The anti-immigrant Alternative for Germany (AfD) party has grown in support while Chancellor Angela Merkel’s popularity has suffered.

Police said on Tuesday the Iraqi, 31, was detained in his refugee hostel on Monday on suspicion of raping a Chinese student and attempting to rape another in the western city of Bochum.

The 17-year-old Afghan was detained on Friday on suspicion of raping and murdering a 19-year-old German student as she cycled home from a party in the southwestern city of Freiburg.

The Iraqi man is accused of dragging the two Chinese students aged 21 and 27 into a bush and forcing himself on them in separate incidents on Aug. 6 and Nov. 16, a police official said told reporters.

Prosecutors are checking if the man, who has denied the accusations, could have committed other crimes.

The Freiburg incident caused outrage when it came to light.

The Berlin newspaper Tagesspiegel said it had withheld from publishing on its website around 40 percent of user comments on the topic as they were slanderous, racist or defamatory. That compares with around 10 percent on any other issue.

In an interview with ARD television late on Monday, Merkel was asked about the rape and murder case in Freiburg and she warned against tarring all refugees with the same brush.

“That was a terrible murder and, if it turns out that it was an Afghan refugee, then that is to be condemned, just as is the case with any other murderer,” Merkel said.

“But then I say that this can’t lead to the rejection of an entire group, just as we don’t draw conclusions about an entire group from one person in other circumstances,” she added.

Merkel’s Vice Chancellor Sigmar Gabriel and government spokesman Steffen Seibert also warned against a backlash after the Freiburg case.

Public concerns about women’s safety and the integration of the mostly Muslim migrants have come to the fore since hundreds of women were sexually assaulted and robbed by men of North African and Arab appearance during New Year festivities in Cologne on Dec. 31.