A gunman shot five people Thursday, killing two of them, in a rampage through two houses and an elementary school that ended when he wounded himself, police said.

One of the slayings occurred at the school, which was not in session. Police Chief David Demag said he could not confirm earlier reports that the victim was a teacher preparing for the start of classes next week.

One television report said about 30 staff were in Essex Elementary School. At one point, people could be seen running from the school, ducking their heads.

"At this point the scenes are secured and the community is safe," Demag said about two hours after the first reports of a shooting. "We have a suspect in custody. The suspect has identified himself as the only shooter. He is secure."

Demag said the shooter and the other three wounded people were taken to a hospital, but their conditions were not immediately known. The chief said he could not provide the shooter's identity, or a motive other than that the shootings appeared to stem from a domestic dispute.

Demag said one person was killed in the first shooting, which occurred at a home. The shooter then went to the school, where he fatally shot one person and wounded two others, Demag said.

The shooter then went to a condominium complex where he wounded a person before turning the gun on himself, the chief said.

Jillian Schultz, 22, who lives at the complex, said she was in the yard playing with her son and the son of a neighbor she knows only as "Chad" when a man ran past her, asking "Where's Chad? Where's Chad?"

Moments later, she heard four gunshots. Schultz said she gathered the children and "got out of there."

She said she then saw Chad, whose last name she did not know, come toward the building, bleeding from the back and yelling to call 911.

The alleged shooter was apprehended on a lawn between the condominiums and a neighboring greenhouse business, said Peter Bearor, who was arriving home from work at the time.

Dozens of police officers, including some tactical units armed with automatic weapons, converged on the school in northern Vermont, near Burlington.

David Pariseau of South Burlington said his wife, Ellen, a first-grade teacher at the school, told him she and six or seven other teachers had locked themselves in a classroom. They and others at the school eventually were taken to a supermarket about a half-mile away where authorities were not allowing them to talk with reporters.