Social services in Vännas were alerted to the pupil's living conditions at Liljaskolen high school near Umeå in northern Sweden last month, although the story has only just emerged in the Swedish media.
According to Swedish news network SVT, which has visited the basement, the student had been staying in a room which stank of vomit and faeces so badly it made its reporting team "retch easily".
Liljaskolen is attended by 800 students and specializes in teaching snow sports such as skiing and ice hockey alongside vocational subjects including tourism, design and watch-making. Its pupils come from more than 50 municipalities across Sweden, Finland and Denmark.
The school provides several dormitories for students who do not come from the area, funded by Vännas council.
"It [the room] has been discovered and dealt with, and I hope it's the end of it. Absolutely no one should have to stay down there in the basement in the future," acting school principal Maria Öhgren told SVT.
The Social services manager in Vännäs, Ulf Norberg, told the broadcaster that he would not comment on the case.
The school later posted a statement on its website saying that the student was understood to have been staying in the property "illegally" and that the incident had been reported to police.
It added that it would work with the municipality to prevent pupils from sleeping in common areas in future.
The student has been suspended from the high school for undisclosed reasons.