(CNN) -- A 32-year-old truck driver walked into a one-room Amish schoolhouse Monday, binding and shooting three girls execution-style before killing himself, police said.
Eight other girls were wounded in the attack, which police said appeared to be a revenge killing for an incident that occurred two decades ago.
"It would take a miracle for us to not lose more lives today," said Commissioner Jeffrey Miller of the Pennsylvania State Police, adding that the wounded were in critical condition -- two of them "very dire." (Watch how the gunman got in and what he did -- 7:44
The attack was the nation's third deadly school shooting in a week.
The gunman, Charles Carl Roberts IV, was armed with three guns, a stun gun, two knives and a bag holding 600 rounds of ammunition, Miller said.
He was also carrying an assortment of tools and other items, including toilet paper, that led police to believe he was prepared for an extended siege.
"It seems as though he wanted to attack young female victims, and this is close to his residence. That's the only reason we can figure that he went to the school," said Miller. (Read Miller's dramatic account
"It's a horrendous crime scene," he said.
The shooting took place in Lancaster County, about 60 miles west of Philadelphia, at a school run by the Amish community. There were 26 students in the school Monday, 11 of them girls.
(Watch police investigate shooting scene -- 1:00
The school teaches students ranging from 6 to 13, with some older students working as teachers' aides. Two students and an aide were dead at the scene, with one girl dying in a state trooper's arms, Miller said.
The wounded girls were taken to several hospitals in the central Pennsylvania area, some of them with gunshot wounds to the head.
Roberts drove a commercial milk truck, said Miller. He was not Amish, was not previously wanted by authorities and had no known criminal history.
The Bart, Pennsylvania, resident had three children, and left several notes for his family "along the lines of suicide notes," Miller said.
The notes were "rambling" and "didn't make much sense," Miller said.
Roberts' wife tried to call him when she found the notes, Miller said. He returned the call on his cell phone, told her he wouldn't be coming home and "that he was acting out to achieve revenge for something that happened 20 years ago."
"Shortly thereafter, the shooting commenced," he said.
Troopers were unable to contact him and were preparing to storm the schoolhouse when Roberts began shooting, Miller said. Gunman let boys go
The commissioner said Roberts had worked a shift that ended about 3 a.m. Monday and taken his children to their bus stop before beginning his rampage.
Police said he had barricaded himself in the schoolhouse with two-by-four and two-by-six pieces of lumber, which he brought to the scene in a borrowed pickup truck. He did not respond to efforts by police to make contact with him.
Miller said that during the attack, Roberts apparently told students to line up in front of the blackboard. He began to tie his female captives' feet together. He let the 15 boys in the classroom leave.
Miller said Roberts also allowed an adult female who was pregnant to leave with three other adult females who had infant children with them.
The teacher who was released was able to alert authorities, Miller said.
"Apparently, there was some sort of an issue in his past that for some reason, he wanted to exact revenge against female victims. That's all I can tell you right now," Miller said.
Lancaster County's 911 Web site reported dozens of emergency vehicles -- including at least nine ambulances -- were dispatched to Bart Township shortly before 11 a.m. for a "medical emergency." The Lancaster County emergency communications Web site showed 20 incident calls listed to the normally quiet Bart Township at 10:48 a.m.
Shortly after the attack, men, women and girls in traditional Amish clothing gathered in small groups outside the country schoolhouse along a dirt road. Horse-drawn carriages could be seen in a nearby parking lot.
The school is one of about 150 that serve the Amish population of about 200,000, said Donald Kraybill, a sociology professor at nearby Elizabethtown College.
"They typically are one-room facilities operated by Amish parents," Kraybill said. "There usually are not any security concerns or security risks in the schools, so this is quite a shock."
Aaron Meyer, who owns a buggy company in the nearby village of Bird in Hand, said the largely rural Amish country had experienced nothing like the crime in the 25 years he has lived in the area.
"Many of these townships there have no police at all, because there's no crime," Meyer told CNN.
On Wednesday, a 53-year-old man entered a high school in Bailey, Colorado, where he held several female students hostage at gunpoint. He shot one girl before killing himself seconds after a SWAT team stormed the classroom.
A high school student near Madison, Wisconsin, is suspected of fatally gunning down his principal on Friday, after he complained about being bullied and was disciplined for carrying tobacco.