An Iraqi refugee who raped a 10-year-old boy at a swimming pool, calling it a “sexual emergency,” has had his conviction overturned after a court in Austria concluded that the 20-year-old attacker may have been unaware the boy did not want to be abused.

The assailant, identified as Amir A., was taken to the Theresienbad pool in Vienna in December of last year as part of the integration process into Austrian society. He was also provided with a 15-year-old translator to help him integrate.

Once at the pool, Amir A, who had worked as a taxi driver in Iraq, dragged a 10-year-old schoolboy into the changing rooms, locked the door and violently sexually assaulted him.

The boy, known only by his first name, Goran, told a lifeguard he had been attacked, and the police were called. He suffered severe internal injuries and was rushed to a children's hospital. He is still suffering from post-traumatic stress disorder.

After the incident, Amir A. reportedly returned to the swimming pool as if nothing had happened, continuing to have fun and using the diving board.

The assailant, who came to Austria via the Balkans in September 2015, confessed to the rape, saying he had acted because of a “sexual emergency” as he had not had sex for four months. When asked if such actions were legal in his home country, he admitted he knew that “such acts were forbidden in any country of the world,”Kronen Zeitung daily reported.

In June, a court found Amir guilty of grave sexual assault and rape of a minor, and sentenced him to six years in prison. A court awarded the boy’s family €4,730 (US$5,150) in compensation after prosecutors described him as suffering “profound despair,” the newspaper reported.

But on Thursday, the Supreme Court overturned the verdict and ordered a retrial, Heute reported.

The court ruled that while the verdict with regard to the serious sexual abuse of a minor was “watertight,” the written verdict on the conviction of rape cannot be sufficiently proved.

The new trial is likely to take place in 2017, until which time the 20-year-old will remain in custody. In the event that the charge of rape is proved in the new trial, the attacker could be sentenced to up to 15 years in prison, Vienna Online reported.

The mother of the victim, who herself moved to Austria as a Serbian refugee, said her son suffers from severe panic attacks and can only sleep with the help of medication. He "screams and cries" and is "often frightened," she said, as reported by Heute.

There have been a number of reports of similar attacks by asylum seekers at swimming pools across Austria and elsewhere in Europe.

A 37-year-old mother and her four-year-old son were subjected to a sexual assault in the quiet southern Austrian town of Klagenfurt in March, Kurier daily reported.

Authorities in the Austrian town of Mistelbach issued a temporary pool ban for refugees following a sexual assault by a “dark-skinned’ man on a 13-year-old girl in June. According to Austrian newspaper Kronen Zeitung, the girl was first followed by a young man into the women’s changing room. Once there, he forced her to perform oral sex. The girl, however, fiercely resisted and started shouting, forcing the attacker to flee.