Pennsylvania police are investigating why a gunman killed five girls at a rural primary school which serves the Amish, a pacifist Christian community.
Charles Carl Roberts released the boys before shooting the girls
Police say Charles Carl Roberts was heavily armed and equipped for a long siege at the Lancaster County school.
But shortly after entering the school he forced the boys and four women out then tied up the girls and began shooting them, before killing himself.
Five girls were injured - one is in a serious condition and one is critical.
The White House has said it plans to host a conference on gun-related violence in schools after what is the third fatal US school attack in a week.
Pennsylvania state police commissioner Jeffrey Miller said Roberts did not appear to be targeting the Amish and apparently chose the school because he was intent on killing young girls "in revenge for something that happened 20 years ago".
Police are examining suicide notes that the 32-year-old left for his three children.
They are also looking at whether the death of an infant daughter three years ago may have played a role in the attack by the milk tanker driver, who was not Amish himself.
The gunman had called his wife during the siege to tell her he was taking revenge for an old grudge, Mr Miller said.
From the suicide notes to his children and phone calls he made, it was clear Roberts was "angry at life, he was angry at God," Mr Miller added.
In a statement, the man's wife, Marie, described Roberts as a good and loving husband and father.
The local man had entered the one-roomed school in the village of Paradise, armed with guns, knives, and stun gun and 600 rounds of ammunition.
He also brought wood to barricade the doors, a hammer, saw, pliers, wire and tape, as well as toilet paper and a change of clothes.
"It is clear to us that he did a great deal of planning," Mr Miller said.
However, the hostage crisis quickly descended into a bloodbath as Roberts began shooting the girls, whom he had tied and lined up in front of the blackboard. He then turned the gun on himself.
"It appears that when he began shooting the victims, these victims were shot execution-style in the head," Mr Miller said.
Some "were shot in the head, some were shot in the arms," he added.
Request for prayer
By the time police stormed the building, three girls and the gunman were dead.
Two more girls died in hospital - a nine-year-old died at about 0100 (0500 GMT) and a seven-year-old died at about 0430 (0830 GMT).
A six-year-old remains in a critical condition and a 13-year-old is described as being in a serious condition, though she has been able to use non-verbal communication, such as eye movement, to speak to her doctors and family.
The families of the victims have appealed for privacy and for people everywhere to pray for them.
FACTS ABOUT THE AMISH
Anabaptist Christian denomination
Communities in the US and Canada
Many communities reject links to outside world
Most Amish shun modern technology including electricity and cars
Plain clothing - no buttons allowed in some communities
Speak English and a German dialect called Pennsylvania Dutch
The Amish are the Anabaptist Christian descendants of German settlers who reject many types of modern technology in their effort to lead a life true to holy scriptures.
They restrict the use of cars, telephones and television to varying degrees.
The attack on their isolated community comes at the end of a week of gun-related violence in US schools.
Last Wednesday a 16-year-old girl died when an armed man, who also killed himself, took six students hostage at a Colorado high school.
And on Friday, a head teacher at a high school in Wisconsin was killed when he confronted an armed 15-year-old student as he entered the school.