On August 30, 2006, a 19-year-old youth, clad in a trench coat, drove into the parking lot of his former high school in Hillsborough, N.C.--and began firing. Eight random shots wounded two students. When the police arrived, Alvaro Castillo gave up without a struggle. It was Castillo's second exploit involving firearms that day. Earlier Castillo had murdered his father in the family home.

Three months later in the small town of Emsdetten, Germany, 18-year-old Sebastian Bosse posted a video message on the Internet: "I can't f–kin' wait until I can shoot every mother-f–kin' last one of you." He then drove to his former school, armed with out-of-date rifles and homemade pipe bombs. Marching through the building, he shot randomly at students and teachers, injuring 37 people before ending his own life.

And the deadliest school rampage so far occurred on April 16, when a 23-year-old college student named Seung-Hui Cho killed 32 people and wounded 25 others on the Virginia Tech campus in Blacksburg. After police arrived, Cho put a gun to his temple and pulled the trigger.

The overall number of homicides committed at U.S. schools has declined since the 1990s--a trend that jibes with the declining rate of homicides carried out by juveniles across the globe. Yet some of these killings now display a new quality: they are premeditated and choreographed, down to the weapons used and the clothes worn. My colleagues and I have detected a sharp jump over the past decade in the number of such school shootings worldwide--excluding gang-related incidents--that were intended to kill at least two people or a school official. In the U.S., the rate of such extreme killings has declined only slightly in the past four years from an uptick in the late 1990s. Incidentally, the vast majority of the perpetrators are male; by our count, females instigated only four of the 101 school shootings that have occurred worldwide since 1974.

The chances of dying at school remain exceedingly small [see box on opposite page], but the most recent spate of school shootings has cast a dark shadow over a place intended to be a safe, enriching environment for children. This terrifying trend has brought a new urgency to efforts to unravel the roots of such deviance and to help educators, parents and psychologists recognize signs of trouble before a problem escalates.

About two years ago my colleagues and I co-founded the Institute for Violence Prevention and Applied Criminology in Berlin in part to design guidelines for preventing violence in schools. Since then, our work with violent adolescents and adults has helped us understand some of the motivations of young shooters and identify several warning signals that can help predict school rampages.

Many of our insights have come from analyzing the violent fantasies of adolescent shooters. These imaginings take root in a desperate mind that yearns for recognition. Often these young assassins are inspired by examples set by previous shooters. The fantasies typically intensify over a number of years before they are acted on. With time, the mental images become more detailed, and they often become buttressed by a distorted sense of what is just or moral, such as the need to avenge a perceived offense or the belief in a divine right to decide the fate of others.

Early on, troubled teenagers typically keep these fantasies secret, but they increasingly begin to leak their thoughts and plans to friends, chat rooms and even media outlets. Recognizing the signs of such deadly thoughts, as opposed to harmless daydreaming, can enable parents, teachers, social workers and other trusted adults to head off trouble before it begins. We have recently developed strategies for identifying youths at risk, for helping to prevent them from descending into a destructive fantasy world and for reacting expediently in the event of an imminent or actual shooting [see box on page 57].