The assault took place in the southern Jutland town of Haderslev, where local Danish women earlier this year reported that they had been sexually harassed by asylum seekers.
Police confirmed that the man has sought asylum in Denmark and currently resides in Beredskabscenter Haderslev, one of the 80 asylum centres across the country.
The man's Monday court appearance was held behind closed doors and a police spokesman told broadcaster TV2 that the suspect would neither speak to police or the court.
South Jutland Police said that the rape occurred at a school building in Haderslev at 3.30am on Saturday.
“We received a report from a concerned resident who had heard yelling and screaming from the school. We therefore quickly dispatched officers to the scene, where a shocked woman was seen coming out from Sønder Otting Skole,” spokesman Anders Hansen told Jydske Vestkysten.
Police said the man was still on the scene when officers arrived.
“He was nearly caught in the act because he stood there practically zipping his pants up when we found him,” Hansen said.
The 19-year-old victim was taking to a nearby hospital where personnel confirmed that she had been raped.
The 24-year-old asylum seeker will be held in detention until August 11th as police continue their investigation.