The police have registered a case against the boy, who works as a newspaper hawker. (Representational)

A class 10 student in Uttar Pradesh's Bareilly has been detained for allegedly threatening to blow up his school if he was not paid Rs 2 lakh as ransom.

The police have registered a case against the boy, who also works as a newspaper hawker, under sections 386 (extortion by invoking fear of death or grievous hurt) and 507 (criminal intimidation) of the Indian Penal Code (IPC).

According to the school manager, Anil Singh, the boy wrote a letter to the school on Sunday threatening a "Pulwama-like" attack if he was not paid the ransom amount.

He claimed to have planted bombs on the school campus and also in his house.

The police were informed immediately and it rushed a bomb disposal squad to the school which has more than 400 students. However, nothing was found in the search.

The school received another letter on Tuesday again demanding Rs 2 lakh and threatening them with dire consequences.

Police investigations found that the paper used for writing the letters was torn from a science notebook following which notebooks of students of class 9 and 10 were checked and the culprit was found.

Senior police officer Shailesh Pandey said, "We figured out who the accused was. When the police questioned him, he failed to give any satisfactory response and said that someone had forced him to write the letters."

Police say they have registered a case of extortion and were also trying to verify the involvement of a second person in the case.