HEKENG, China—Count the tulou.

It started like a game. How many of these strange, fortress-like structures could I tally from a vehicle window? They were so big, looming like spaceships in the countryside of Fujian Province in southeastern China. Every village seemed to have at least one, two, more.

An obsession grew. I would ask to be left off at the edge of villages tucked between hills, and I would start walking and counting.

In Hekeng, a place with several hundred residents, I ticked off 13 tulou. (Tu lou means "earthen structure" in Mandarin, a very modest definition, like describing a coliseum as a stone circle.) The buildings look medieval, with high mud-brown walls, tiny windows in the top stories, and usually just a single iron-plated wooden door allowing entrance.

Soon I wasn't satisfied with merely standing outside and gawking at tulou, which come in various shapes but are mostly square or circular. I had to go inside each one I counted. The front doors were usually open. So I entered and kept entering. And this is what I found.

First off, the outside doesn't prepare you for what's inside. If the somber exterior resembles a penitentiary, the interior bursts open like a concert hall. Timbered galleries rise majestically as many as five stories high around a light-filled courtyard. Each floor is built of dark wood, with small rooms placed one after another, identical in size, like an architectural chant. Corridors turn or bend the lengths of each floor.

In the open-air courtyard, paved with lumpy cobblestones, there is usually a well or two, plus a small, ornate enclosure for the worship of ancestors. The space commands you to turn around and around to marvel at the dizzying sweep of rooms, the view overhead of sky and mountains, and the audacity of a design that contains a community within a giant impregnable building.

Watch National Geographic photographer Michael Yamashita and his crew set aloft a drone to get a bird's-eye view of the tulou, self-contained fortresses that once housed up to 800 people each, often from the same clan.

Protective Walls

Despite claims of much older tulou, the earliest record of one being built dates to 1558, says Huang Hanmin, an architect who has written extensively about tulou. Its construction coincided with a time of land battles between the clannish Hakka people, who had migrated from the northern Chinese plains, and the region's longer-settled groups.

"From the beginning their main function was to defend the people's safety," says Huang Hanmin, an architect who has written extensively about tulou. "The historic record shows constant threats from wild animals, bandits, and warlords."

To repel threats, builders fashioned walls out of rammed earth, the technical term for a fudge of compressed paddy clay, limestone, and sand that when dried forms a skin as hard as concrete. Many of the walls were at least five feet thick, capable of withstanding cannon shots, flaming arrows, battering rams, and the occasional earthquake.

Population growth and the tumult associated with the 1949 Communist revolution in China—the Hakka were among the revolution's most fervent supporters—meant that tulou building continued well into the 20th century. In Hekeng the construction dates of the 13 tulou ranged from the 1550s to the early 1970s.

View Images

Inside three-story Dongsheng ("East Rising") Lou, completed in 1961, the only structural difference I could see from the earlier tulou was that the rooms looked a bit larger, though they were still barely big enough to hold a double bed.

In Hekeng I met a tea grower named Zhang who told me that his father, an engineer, had supervised the construction of Dongsheng Lou. Each floor, with its thick supporting beams and 22 rooms, took a year to build. I asked if he could ever envision a new tulou rising in the town. Zhang eyed the imposing building, its earth wall textured like wrinkled skin.

"It's impossible to build a new one," he said, shaking his head. "The cost would be five times as high as a concrete and steel building. Plus, figure the amount of labor needed. And where would you find the big trees now?"

View Images 01 hakkahouses Inside a tulou, family homes rise up in "slices" around a shared central courtyard. Each home has a kitchen and dining space on the ground floor, storage one story up, and bedrooms on the upper stories. Photograph by Michael Yamashita, National Geographic

Inside Clan Life

Almost everyone I met in Hekeng was named Zhang. Villages in the Fujian highlands are clan-based settlements, with a single surname predominant. Hekeng was a Zhang village. There are also Su villages and Li villages and Jian villages, among others.

To accommodate the needs of these tight-knit communities, the tulou evolved into a structure where entire branches of a clan, often numbering in the hundreds of people, could live together in one building, a design unique in the world. A castle in western Europe would open its gates to villagers only in times of attack or siege. A tulou protected and housed people all the time.

Living space in a tulou was organized vertically, a necessity in a mountainous region with limited flat land. Each family, depending on its size, could own one or more bays. The first floor, open to the courtyard, was the kitchen and dining area; the second floor was a storeroom; the third floor and those above held bedrooms. Huang compares the design to an orange divided into segments facing a central point.

Everyone used the same corridors and stairways. Rules of conduct (clean up waste, respect elders, contribute to festivals) were posted inside the entrance. As the ultimate communal gesture, rooms were identical in size and decoration, whether they belonged to the Hakka clan leader or a common pig farmer. (Another Fujian people, the Minnan, adopted a more private layout, with the vertical housing slots equipped with individual stairways and enclosed corridors.)

You won't find many tulou perched on a mountaintop like the feudal castles of Europe. Almost all are down on the valley floors, ideally with a mountain at their back and water in front. They were sited according to the principles of feng shui ("wind and water"), the traditional Chinese art of environmental fortune-telling.

View Images Children from the surrounding tulou and other homes play outside the Chuxi village primary school. Often parents leave small villages such as Chuxi to find work in bigger cities, while their children stay behind to be raised by grandparents. Photograph by Michael Yamashita, National Geographic

Part common sense, part mysticism, feng shui is believed to align humans with the positive energies of their surroundings. An auspicious setting, say its adherents, will guarantee wealth, influence, and an abundance of offspring. A mountaintop, unsheltered from wind, doesn't bode well for health and tranquility.

One day I asked feng shui practitioner Zhang Shou Ru to critique the layout of the village of Hekeng. The wizened 85-year-old man outpaced me to a viewpoint and was smoking a cigarette when I arrived. Zhang approved of how the mountains in the back of the village looked like the humps of a dragon, a sign of good energy. He liked that two streams joined in town but worried that because of the way the water straightened out as it flowed out of town, more money would leave Hekeng than stay there.

As far as the fates of individual tulou, he squatted at the front doors of several, pulled out his specialized compass with its 24 directions, and said—each time with grave pleasure—"These are good places."

View Images Kindergarten students take a small bus home in Hekeng village. The number of schools in small villages is shrinking as the population declines, so children must travel farther to attend school. Photograph by Michael Yamashita, National Geographic

An Exodus From the Countryside—and the Tulou

The feng shui of the Fujian highlands as a whole must be good because these days tourist money is streaming into the region.

The bonanza began in 2008 when 46 tulou in Fujian were selected as World Heritage cultural treasures, including Hekeng's cluster of 13. On weekends the rural lanes are often gridlocked with vehicles and pedestrians, and the tulou themselves can be swamped with visitors, the majesty of the architecture competing for attention with merchant stalls selling everything from tea and medicinal mushrooms to Mao posters and tulou-shaped ashtrays.

Not until the 1950s did the outside world, urban China included, even know that tulou existed. Those in southern Fujian didn't come to light until three decades later.

The remoteness of the region, its poor roads, and the emptying of its villages (the Hakka have migrated in large numbers to Taiwan, Singapore, and other Asian countries) had kept the region's distinctive architecture a secret. Huang Hanmin was one of the first scholars to study the area, traveling between villages by bicycle.

View Images 01 hakkahouses Left: Some tulou have been abandoned to nature, such as Liben Lou, destroyed in 1931 during the Chinese Civil War. Right: After years of working in factories, Li Chen returned to his wife's ancestral tulou, Shunyu Lou, to raise pigs and teach his daughter traditions such as harvesting honeysuckle. Photograph by Michael Yamashita, National Geographic

Huang is the preeminent tulou counter. Based on his travels, correspondence with academics and locals, and the study of satellite photography, he now tallies the number of tulou—of all shapes and sizes—at exactly 2,812, nearly a thousand fewer than earlier estimates. "More than 46 deserve to be on the World Heritage List," he says.

"Where is everybody?" That was my reaction almost every time I stepped inside a tulou. In places built to hold hundreds of people, often only five or six residents remained. They were mostly old-timers, frail and living alone. Weeds often grew among the cobblestones, and the wells held stagnant water. Sometimes a small child stood in the shadows, one of the so-called "left behind children," consigned to the care of an aged relative while the parents live and work in a distant city.

View Images Five-story Yuchang Lou, one of the tallest tulou, draws a lively tourist crowd on a May holiday. Only a few families still call Yuchang Lou home, but they make a living charging for entry, serving tea, and selling trinkets. Photograph by Michael Yamashita, National Geographic

Tulou have been losing people in droves for at least 25 years, since China revved up its economy and a consumer society took off. People didn't want to live in cramped spaces with no indoor plumbing.

"Only poor people live in tulou anymore," I often heard people say.

"People's hearts are different now," said Lin Yi Mou, who showed me around Eryi Lou, in its heyday a magnificent, richly decorated tulou with 400 inhabitants, but today a museum with most of its rooms padlocked.

"In the past," he said, "when the tulou belonged to a big clan, each family would contribute money for repair. Now they don't want to spend money on something that belonged to their ancestors. They want to spend it on themselves."

View Images A death in a tulou affects everyone in the building, which is often occupied by just one family group or clan. At Yangzhao Lou in Hekeng village, professional mourners in white and blue augment the family's wailing—a traditional sign of respect—for 90-year-old Su Shi Yaying, one of the tulou's matriarchs. Photograph by Michael Yamashita, National Geographic

Only on national holidays do tulou stir with anything like their former beehive bustle. Long-absent family members sweep in to visit relatives, attend weddings, and sleep in the rooms they once called home.

During the May Day weekend, I listened to prodigal sons and daughters profess nostalgia for tulou living. "There were so many children to play with back then; it was warm and cozy in winter; we felt safe." After a short stay, all returned to their modern houses.

A Model for the Future?

Tulou as physical objects won't disappear. The walls were built to last centuries. As a practical design, tulou might even make a comeback. Engineers and architects studying rammed-earth construction see the tulou as a prototype of a "green" building: energy efficient, harmonious with the landscape, and built from local, natural materials.

View Images A dragon parade travels from tulou to tulou through the town of Meilin in a celebration of Mazu, goddess of the sea, who is worshipped by the Hakka as a protector. Photograph by Michael Yamashita, National Geographic

According to Canadian architect Jorg Ostrowski, the famous four-ringed Chengqi Lou, built in the early 18th century, would far exceed LEED certification, a prominent building-industry rating system for sustainable construction. In neighboring Guangdong Province, just outside Guangzhou, a dense megacity with some 14 million people, architects for the Urbanus firm designed a successful modern version of a tulou for 278 low-income families.

"I can easily imagine this concept, with its sense of collective space, being adapted today for schools, libraries, and yes, even prisons," said Meng Yan, a lead designer.

Even old tulou can become something new.

In the tourist town of Taxia, near many of the World Heritage buildings, entrepreneur Zhang Min Xue took a tulou that had been abandoned for eight years and with a year's work converted it into a guesthouse called Qingde Lou.

"The hardest part was putting in modern plumbing," Zhang told me.

I stayed there. It was noisy, filled with people. Laundry hung from the railings. Chickens strutted over the cobblestones. Candles burned in front of an image of a local deity. And at night the heavy front door swung shut. This was a tulou.