(Getty Images)

When my daughter was growing up, she often wanted to rush off to do fun things with her friends — get into the water at the beach, ride off on her bike — without taking the proper safety precautions first. I’d have to stop her in her tracks to first put on the sunscreen, or her bike helmet and knee pads, with her standing there impatiently. “Safety first, fun second,” was my mantra.

Keeping ourselves and our loved ones safe from harm is perhaps our strongest human motivation, deeply embedded in our very DNA. It is so deep and important that it influences much of what we think and do, maybe more than we might expect. For example, over a decade now of research in political psychology consistently shows that how physically threatened or fearful a person feels is a key factor — although clearly not the only one — in whether he or she holds conservative or liberal attitudes.

[A political scientist has discovered a surprising way to increase voter turnout. It starts in childhood.]

Conservatives, it turns out, react more strongly to physical threat than liberals do. In fact, their greater concern with physical safety seems to be determined early in life: In one University of California study, the more fear a 4-year-old showed in a laboratory situation, the more conservative his or her political attitudes were found to be 20 years later. Brain imaging studies have even shown that the fear center of the brain, the amygdala, is actually larger in conservatives than in liberals. And many other laboratory studies have found that when adult liberals experienced physical threat, their political and social attitudes became more conservative (temporarily, of course). But no one had ever turned conservatives into liberals.

Until we did.

In a new study to appear in a forthcoming issue of the European Journal of Social Psychology, my colleagues Jaime Napier, Julie Huang and Andy Vonasch and I asked 300 U.S. residents in an online survey their opinions on several contemporary issues such as gay rights, abortion, feminism and immigration, as well as social change in general. The group was two-thirds female, about three-quarters white, with an average age of 35. Thirty-percent of the participants self-identified as Republican, and the rest as Democrat.

But before they answered the survey questions, we had them engage in an intense imagination exercise. They were asked to close their eyes and richly imagine being visited by a genie who granted them a superpower. For half of our participants, this superpower was to be able to fly, under one’s own power. For the other half, it was to be completely physically safe, invulnerable to any harm.

If they had just imagined being able to fly, their responses to the social attitude survey showed the usual clear difference between Republicans and Democrats — the former endorsed more conservative positions on social issues and were also more resistant to social change in general.

[Stanford researchers: The secret to overcoming the opioid crisis may lie partly in the mind]

But if they had instead just imagined being completely physically safe, the Republicans became significantly more liberal — their positions on social attitudes were much more like the Democratic respondents. And on the issue of social change in general, the Republicans’ attitudes were now indistinguishable from the Democrats. Imagining being completely safe from physical harm had done what no experiment had done before — it had turned conservatives into liberals.

In both instances, we had manipulated a deeper underlying reason for political attitudes, the strength of the basic motivation of safety and survival. The boiling water of our social and political attitudes, it seems, can be turned up or down by changing how physically safe we feel.

This is why it makes sense that liberal politicians intuitively portray danger as manageable — recall FDR’s famous Great Depression era reassurance of “nothing to fear but fear itself,” echoed decades later in Barack Obama’s final State of the Union address — and why President Trump and other Republican politicians are instead likely to emphasize the dangers of terrorism and immigration, relying on fear as a motivator to gain votes.

In fact, anti-immigration attitudes are also linked directly to the underlying basic drive for physical safety. For centuries, arch-conservative leaders have often referred to scapegoated minority groups as “germs” or “bacteria” that seek to invade and destroy their country from within. President Trump is an acknowledged germaphobe, and he has a penchant for describing people — not only immigrants but political opponents and former Miss Universe contestants — as “disgusting.”

“Immigrants are like viruses” is a powerful metaphor, because in comparing immigrants entering a country to germs entering a human body, it speaks directly to our powerful innate motivation to avoid contamination and disease. Until very recently in human history, not only did we not have antibiotics, we did not even know how infections occurred or diseases transmitted, and cuts and open wounds were quite dangerous. (In the American Civil War, for example, 60 out of every 1,000 soldiers died not by bullets or bayonets, but by infections.)

Therefore, we reasoned, making people feel safer about a dangerous flu virus should serve to calm their fears about immigrants — and making them feel more threatened by the flu virus should cause them to be more against immigration than they were before. In a 2011 study, my colleagues and I showed just that. First, we reminded our nationwide sample of liberals and conservatives about the threat of the flu virus (during the H1N1 epidemic), and then measured their attitudes toward immigration. Afterward we simply asked them if they’d already gotten their flu shot or not. It turned out that those who had not gotten a flu shot (feeling threatened) expressed more negative attitudes toward immigration, while those who had received the vaccination (feeling safe) had more positive attitudes about immigration.

In another study, using hand sanitizer after being warned about the flu virus had the same effect on immigration attitudes as had being vaccinated. A simple squirt of Purell after we had raised the threat of the flu had changed their minds. It made them feel safe from the dangerous virus, and this made them feel socially safe from immigrants as well.

Our study findings may have a silver lining. Here’s how:

All of us believe that our social and political attitudes are based on good reasons and reflect our important values. But we also need to recognize how much they can be influenced subconsciously by our most basic, powerful motivations for safety and survival. Politicians on both sides of the aisle know this already and attempt to manipulate our votes and party allegiances by appealing to these potent feelings of fear and of safety.

Instead of allowing our strings to be pulled so easily by others, we can become more conscious of what drives us and work harder to base our opinions on factual knowledge about the issues, including information from outside our media echo chambers. Yes, our views can harden given the right environment, but our work shows that they are actually easier to change than we might think.

John Bargh is a professor of social psychology at Yale University and the author of “Before You Know It: The Unconscious Reasons We Do What We Do”