The 37-year-old man was found dead later. He had apparently shot himself after fleeing the school in Sankt Poelten, west of Vienna.
Austria’s state broadcaster ORF said the man had hauled his son and daughter out of their classes and shot the seven-year-old boy in the cloakroom.
Police are quoted as saying the man had a record of domestic violence.
Der Standard news website says doctors performed emergency surgery on the wounded boy. His condition has been described as “very critical”.
By coincidence four paramedics were already at the school when the shooting happened, because they were telling the children about first aid, the website reports.
They got to the boy less than a minute after he was shot and five minutes later an emergency doctor arrived, so the boy was quickly given artificial respiration.
A local education official said police tracked the father down by locating his mobile phone signal.
His body was found inside an overturned car on a highway. According to police he had run a kebab stand near the school, ORF said.
Child psychologists are now at the eight-classroom school to give the children counselling.