Bengaluru, Sept. 7 -- It took a viral video to expose what official machinery had apparently failed to see for five years: 172 children studying in a Karnataka government residential school had been living, eating and attending classes in a cowshed.

The students of Dr BR Ambedkar Residential School at Shantigrama in Hassan district were shifted to two separate hostels on Monday, days after videos of their appalling living conditions triggered public outrage.

The school, run by the Social Welfare Department, caters to children from Scheduled Caste, Scheduled Tribe and other disadvantaged communities. It has 92 boys and 80 girls studying in Classes 6 to 10.

For nearly five years, the school had reportedly functioned from a cowshed rented a...