BERLIN — A German court convicted an Iraqi man on Wednesday of raping and murdering a teenage girl, and sentenced him to life in prison, a year after the case fueled far-right protests across the country and prompted anger at the government’s handling of rejected asylum claims.

The court in Wiesbaden, in western Germany, ruled that the crime committed by the Iraqi, Ali Bashar, 22, was especially egregious, making it less likely that he will ever be paroled. Mr. Bashar had confessed to killing the girl, Susanna Feldmann, 14, but had denied raping her.

Mr. Bashar and his family arrived in Germany in 2015 — along with more than 1 million others, many from Afghanistan, Iraq and Syria — and applied for asylum. His claim was rejected the following year, but he was allowed to remain in the country.

The case outraged opposition politicians, especially members of the far-right Alternative for Germany, who cited it as evidence that Chancellor Angela Merkel’s government had lost control over the refugees who had poured into the country.