A QUARTER-CENTURY ago, my wife Michelle and I thought we would casually veer off Interstate 95 on our way back from Florida to see Daufuskie Island, S.C., home of a unique black culture that thrived in isolation after white landowners fled the area during the Civil War. But to get to the dock, we first had to go through Hilton Head.

We arrived at a gate. A white private security guard with a handgun strapped to his hip and a machine gun slung over his shoulder asked me for my driver’s license. He let us through, but Michelle and I were flabbergasted at this show of arms, which was presumably meant to scare off anyone who might threaten the wealthy inhabitants. This was more like the entry to a military base or prison.

It was our first encounter with a gated community. It was disturbing then, and it feels even more disturbing now, after the killing of Trayvon Martin by a neighborhood watch vigilante in a gated community in Sanford, Fla. That case has highlighted the stereotyping of black youth and the insanity of Florida’s “stand your ground’’ self-defense law. But it also exposes the paranoia that has fueled the growth of gated communities.

There are now 10.8 million housing units in gated communities — communities that are surrounded by walls and fences and often patrolled by private guards. These units represent nearly 10 percent of all US housing; only 3 percent of them are owned by African-Americans. Such communities are sold on the promise of security. Yet in 2009, the Charlotte Observer quoted the Charlotte-Mecklenburg County police chief as saying there was no difference in crime between gated and nongated communities. In fact, some researchers posit that gated communities actually attract crime because of the perceived valuables within.

Even when residents of gated developments feel safer, they have a low sense of community, said Georjeanna Wilson-Doenges, a University of Wisconsin at Green Bay professor who studied gated communities in California. “People call it ‘bulwarking,’ ’’ she said. “A resident in many gated communities drives up to a minimum-wage person at the gate or slips a card into a slot to open a gate, drives into a garage, shuts the door, turns off their alarm they had on all day, closes the door, and then activates the alarm at night. That does not indicate people are less fearful.’’

Others who’ve studied the issue have reached similar conclusions. Rich Benjamin, an African-American who lived in predominantly white gated communities while researching his book “Searching for Whitopia,’’ recalled a column he read from a woman who lived in a Utah gated community. Despite the gates, she wrote in her local newspaper in 2004, “Every person who is legally able to obtain a gun permit or concealed weapon permit should do so. This includes teachers and administrators in our public and private schools. Store owners and restaurant managers should be prepared to protect themselves and others . . . we live in an ‘us against them’ world.’’

As it happens, that’s how my wife and I felt when we pulled up at the guardhouse on Hilton Head. When people constantly feel the need for tight protection under ordinary circumstances, it has to change the way they think. That likely happened to George Zimmerman, the armed neighborhood watch coordinator who kept pursuing Trayvon Martin even after a police 911 dispatcher told him not to.

This is a classic example of how America’s obsession with firearms and personal vigilance actually makes it harder for law enforcement to do its job. Rosalind Greenstein, a professor of urban planning at Jackson State University in Mississippi, argues that the tragedy in a gated community highlighted the confusing intersection of highly privatized security, public police, and laws like “stand your ground.’’

My experience at Hilton Head came well before social scientists coined the term “Fortress America’’ to describe the nation’s gated communities. The Trayvon Martin killing makes it clear where this fortress mindset can lead.

If his death is to have any positive legacy, it should signal a taking down of the gates.