(CNN) -- Authorities rescued 30 children and four teachers from a man wielding a hammer and a machete in southern Malaysia on Thursday, the country's national news agency said.
After six hours of tense negotiations with the hostage-taker, authorities stormed the kindergarten. The man was shot in the head and was in critical condition, the Bernama news agency said.
During the negotiations the man demanded a gun and said if he did not get the weapon he would harm the children.
A psychiatrist was brought to the scene and helped to calm the situation. And at one point the children could be heard singing in another effort to help calm the situation, the news agency reported.
CNN's Eve Bower contributed to this report.