"One student died in the shooting, three were taken to the hospital," the government wrote on X, formerly known as Twitter.

The attack took place in the neighborhood of Sapopemba, located in the eastern part of the eponymous city of Sao Paulo, in the morning.

The police managed to detain the perpetrator, Brazilian news website G1 reported.

The police have not shared information about a potential motive.

This is the second school attack in Sao Paulo in just seven months.