Eight people were injured in the attack, one of whom is a child who has died, according to the state news agency Hina, citing the Health Department.
Both students and teachers are among the injured.
The attack took place at 9:50 am. According to the state television HRT, the perpetrator went straight into the first classroom he found and began the attack.
"A young man attacked a teacher and several students with a sharp object at a school in the Precko area", reads an initial statement from the police.
The perpetrator has been arrested on the spot. The injured are receiving care at various hospitals in Zagreb.
Mobile footage in Croatian media shows children running from the school building.
The authorities are still working to determine exactly what happened, announced Prime Minister Andrej Plenkovic.
We, like the entire Croatian public, are shocked by the terrible tragedy at an elementary school, said Plenkovic before a government meeting.
School attacks are rare in Croatia.