Chikkaballapura (K'taka): A class 9 student of a government residential school was eight months pregnant when she gave birth to a baby boy at a hospital here, police said on Thursday, following which a case of rape under the IPC and POCSO has been registered.