"On April 29, law enforcement agencies determined that the suspect had schizophrenia," the local police said in a statement.
The attacker was detained by the police following the attack on Wednesday. According to the police, two of the 18 injured in the attack have died and the other 16 survivors are in stable condition.
Local police said earlier that 16 children and two teachers were injured during the attack. The police did not identify whether the deceased victims were children or the teachers.
Following the tragic attack on Wednesday, the Chinese ministries of education and public security issued urgent directives instructing schools in the country to boost security measures on campus.