At 2:50 PM on Monday, April 15, I was sitting in my Cambridge office, separated from the finish line of the Boston Marathon by 2.5 miles of parks, city streets, and the iconic Charles River. Around 3:00 PM, I started receiving what would soon become a flood of messages—texts, emails, and Facebook chats, from friends, family members, and high-school classmates: “Are you ok?” “Are you safe?” “You’re not at the marathon, are you?”

This is how I learned what else happened at 2:50 PM. This is how I learned that mere miles away, two home-made bombs had detonated, killing three people and wounding 183 more. And this is what led me to pace the halls of my building, knocking on every door; to contact, in any way possible, friends I knew were there, at that finish line; to make sure that these people—my people—were safe.

In times of distress and unease—of apparent attack—it’s easy to think in us-vs-them terms: to care only about our people, our city, our country.

But if these attacks were perpetrated against any “us,” it was the “us” of humankind. The official list of marathon participants includes more than 23,000 athletes: males and females ranging in age from 18 to 83; runners, handcyclists, and wheelchair operators; citizens of 96 different countries and 6 of 7 continents (only Antarctica—which is not home to any permanent human residents—was not represented). They were us. And they were diverse.

The bombs exploded at a site celebrating this magnificent diversity—along the home stretch of the Marathon, a section of Boylston Street lined with the flags of each participant’s native country. This diversity was also displayed by the injured, and the dead—an 8-year-old boy, a 29-year-old restaurant manager, a 23-year-old Chinese graduate student.

This was, and is, a tragedy. There is no denying it.

But in the midst of this tragedy, there also was—and is—an unmistakable beauty.

In the immediate aftermath of the explosions—even as debris continued to fly through the air—countless people ran not away from the blasts, but towards them. These people had no way of knowing whether or not there would be more explosions, no way of knowing whether or not they were putting their own lives in danger; they simply saw others in need and immediately rushed to help. At the same time, more people—many of them marathoners who had just completed a draining 26.2 mile test of endurance—began to rush en masse to nearby Massachusetts General Hospital, seeking to give their own blood for the hundreds of wounded that would soon follow. In fact, so many people showed up that the hospital was forced, multiple times, to turn away would-be donors; there were simply too many people trying to help.

These overwhelming displays of helping—of selflessness and what psychologists call “prosocial behavior”—are beautiful in and of themselves. But they are even more beautiful because they transcend us-vs-them ways of thinking. These actions were not reserved for members of one group, one city, or one country; they were enacted without preference or prejudice, directed at victims of every color, creed, age, and gender. And they are still more beautiful because of their immediacy. These actions were not the result of carefully considered decisions, of weighing the pros and cons of each possible behavior; they were virtually instantaneous, seemingly born of a raw, instinctive urge to help those in need. In the face of overwhelming tragedy, people sought to help the “us” of humankind—immediately, prodigiously, and with little regard for their own safety.

A long tradition of research in social and evolutionary psychology tells us that this behavior doesn’t make sense. That people operate according to fundamentally selfish instincts, and that these selfish instincts can be found in every organism, every cell, and every gene. According to this tradition, thinking of any “us” at all can be explained as a means to the end of preserving one’s own physical and psychological well-being, living to see another day, and producing children that have a reasonable chance of doing the same. Ostensibly altruistic behaviors—everything from sharing resources to laying down one’s life to save others—can be explained by fundamentally selfish motives like reputational concerns (the desire to be seen in a positive light), kin selection (the desire to preserve one’s genetic material, sometimes even at the cost of one’s own life), or simply a desire to ease the personal discomfort that comes along with viewing others in distress. In short, people help others to help themselves.

But other research tells a different story. When people find “lost” letters on the sidewalk, they tend to mail them to the intended recipients, even though this good deed will receive no recognition or reward, does nothing to further their own genetic legacy, and probably does not relieve much personal distress. People make anonymous financial donations, and as many as 32% are even willing to anonymously donate their own internal organs—while still living—to complete strangers. Even children who are four years old spontaneously help others with no apparent concern for approval from friends and/or authority figures, personal benefits, or moral (good/bad) imperatives. Examples such as these provide a counterargument to the selfish view of human nature that has long dominated psychological research. They suggest that people may help others with little or no thought for their own well-being; people may help others simply because they need to be helped.

Of course, it could be that these heartwarming actions can also be explained by selfish motives, ones that are simply more difficult to pin down. Or it could be that these actions represent the outcome of hard-fought battles pitting conscious control against selfish core impulses—victories for virtue, yes, but ones that require continuous effort and are likely to be surrendered as soon as people are unable or unwilling to continue overriding their selfish impulses. It could be that when caring for others threatens people’s own welfare, they will retreat into increasingly smaller moral circles—from caring for the “us” of humankind to the “us” of their families, friends, and ingroup members; from caring about this restricted “us” to only caring about themselves. It could be that, when people are put to the ultimate test, self-preservation will always win out.

The Boston Marathon bombings put people to this test. The attack created chaos, pain, and destruction; it destroyed lives and landscapes. It destroyed pretense. Those on the scene were immediately forced to face the jarring reality of those who had already been injured—a reality that represented both these victims’ need for help and the possibility that providing help could result in personal injury from further explosions. In this situation, people had neither the time nor the resources to override impulses or think strategically; they could only react, behaving intuitively and emotionally.

It is in these reactions that I see beauty. In the initial movements of the helpers—the first responders, the blood donators, the countless men and women who rushed in to do anything and everything they could to fix the gaping hole left by those Monday afternoon explosions—I see an extreme example of the human capacity for selflessness. I see evidence that people tend to intuitively, instinctively, and perhaps automatically reach out to others in times of need. I see that extreme situations can cause people to transcend us-vs-them thinking, uniting diverse peoples into the “us” of humankind.

In the few days since the bombings, the intervening events—continued loss of life, a night filled with sirens and shootouts, a day spent in “lockdown,” the capture of a 19-year-old, and the heartfelt displays of appreciation for law enforcement—have threatened to prematurely relegate the explosions on Boylston Street to the past. Similarly, the delayed reactions of some—actively seeking a “them” to set up in opposition to “us”—have threatened to overshadow the immediate and selfless reactions shown by those at the scene. Taken together, these actions and reactions show that people are complex, confusing, and often self-contradictory. However, they also highlight the immense capacity for human goodness present in the midst of this complexity.

They offer the hope, at least, that the good in people will always overcome the bad.

Are you a scientist who specializes in neuroscience, cognitive science, or psychology? And have you read a recent peer-reviewed paper that you would like to write about? Please send suggestions to Mind Matters editor Gareth Cook, a Pulitzer prize-winning journalist at the Boston Globe. He can be reached at garethideas AT gmail.com or Twitter @garethideas.