Baku has always been at the crossroads of something. Caught between the empire-building machinations of the Persians, the Russians, and the Turks, it languished under the control of one or another of those civilizations for centuries. Now the city and its country are experiencing a breakthrough, but one roiled by an authoritarian government, the vicissitudes of an oil economy, and the challenge of integrating Islamic customs with modern Western secularism.

“The true identity of this territory has been suppressed,” Azeri filmmaker Teymur Hajiyev tells me the next evening as we sit at a traditional restaurant beside a stone wall that is almost a thousand years old. “We speak Russian, our names are Islamic or Persian, we try to be Turkish. We have a Frankenstein culture. We haven’t figured out what it means to be Azerbaijani.”

View Images Friends pose at of Dagustu Park with an unparalleled view of Baku over the bay. Photograph by Rena Effendi

The turbulence is playing out in what can only be called an epic setting. The Caspian Sea waterfront must compel grand architectural gestures because Baku’s rulers always have been partial to them. From the domed 15th-century Palace of the Shirvanshahs (named for the rulers of Shirvan, a onetime Azeri state) to the ornate fin de siècle mansions of the first oil boom, to the muscular office blocks built by the Soviet Union, those architectural gestures make rounding each corner a potential moment of discovery. Now the Aliyev family, which has presided over Azerbaijan since 1993, has applied a new level of ambition to the construction: Additions such as the swooping Heydar Aliyev Center and the triad of curved, glass-sheathed skyscrapers known as the Flame Towers are headed toward iconic status. Even as Baku’s two million-plus residents struggle to define themselves, they live in a place that looks like nowhere else.

President Ilham Aliyev—who succeeded his father, Heydar, a former Politburo leader who governed Azerbaijan as though still in the U.S.S.R.—runs the nation like a Persian Gulf emir, using government money, of which there is plenty when oil prices run high, to nudge it into the world’s consciousness. Baku has hosted the World Chess Olympiad, the European Games, and the Eurovision Song Contest (even though Azerbaijan isn’t technically in Europe); staged Formula 1 Grand Prix races; and made bids, unsuccessful, for the Olympics. Many of the world’s luxury hotel brands, including Four Seasons, Fairmont, Jumeirah, and Hyatt Regency, have acquired Baku outposts. But Ilham Aliyev’s most effective marketing tool has been architecture, from an ultramodern airport to shiny sports venues, a grand war memorial, and shopping malls that look like spaceships. (One architectural project in particular has received attention in recent times: the involvement of America’s First Family in a flashy hotel and condo project being built by an Azeri family said to be close to the Aliyevs.)

View Images All fluid folds, the curving Heydar Aliyev Center is named for Azerbaijan's third president–and has won awards for its starchitect, the late Zaha Hadid. An airy light-filled interior houses a museum of Azeri history, art exhibits, collections of dolls and vintage, cars and a café. Photograph by Rena Effendi

The Heyday Aliyev Center has been compared to a whale, a glacier, and an airport terminal. None of those give the swooping building, which the late Pritzker Prize-winning architect Zaha Hadid considered a dream project, its due. Viewed from any angle you would swear it’s in motion, its undulating whiteness rising to a peak and slowly rippling down the other side. To the west, on the waterfront, sits another showstopper. A low, tubular building designed to resemble a rolled-up rug, the Azerbaijan Carpet Museum is the wittiest building in town. Each time I pass it, I grin. And though two of the three Flame Towers have yet to fill with many tenants beyond a Lamborghini dealership, they have become Baku’s new signature, overtaking the millennium-old World Heritage site known as Maiden Tower, once part of the city’s fortifications.

Not everyone is pleased with this. “Baku was a small Paris,” artist and social activist Sitara Ibrahimova tells me when we meet. “It has become a small Dubai.” Ibrahimova is proud of her heritage. Tattoos on her ankle depict rock carvings in the Gobustan Preserve. (Norwegian ethnographer and adventurer Thor Heyerdahl believed Azerbaijan was the site of an ancient civilization where Vikings originated.) She takes me to see two of her installations at the Yarat Contemporary Art Centre. For one installation she shot film of herself wading in the Caspian Sea and scrubbing her arms not with water but with black oil. Titled “Naftalan,” it is, she says, a “musing on the resource’s over-whelming significance in framing the collective unconscious of the country.”

That night I join her at a small, sleek wine bar, Kefli, in the heart of Baku. We push past a knot of smokers into a crowded room lit by hanging wine-bottle lamps. I could be in Moscow, or Brooklyn, except that all 17 wines on the menu are Azeri. I hadn’t realized Azerbaijan produces wine. Kefli’s co-owner, a 30-year-old lawyer named Rufat Shirinov, tells me he opened the wine bar (with business partner Ivan Uvarov) as a sort of patriotic act. “A lot of very Azeri things were lost in the Soviet years,” he says.

View Images The sun shines over Baku's Presidential Palace and the Flame Towers, as seen from the medieval Shirvanshah's Palace in the Old City. Photograph by Rena Effendi

Over the centuries, Azeris have survived by adapting. They bent to the will of the Persians, fell in line under the Russians, yet never quite submitted. “The best way to retain our identity, that core of language, music, and cuisine that differentiates us from our neighbors, was through flexibility,” explains history enthusiast Fuad Akhundov. This led to tolerance. It’s no accident that three distinct Jewish communities, one of Ashkenazim, one of Georgian Jews, and one of Mountain Jews (descendants of Persian Jews), have survived pashas, caliphs, and commissars. While Ibrahimova is exploring an Azerbaijani vernacular with her art, Kefli’s Shirinov looks to the soil. He serves me two wines made from the local red Madrasa grape, then a white Bayan Shira. I prefer them as political statements rather than as beverages, but the wines are proving to be plenty palatable for the twentysomethings around me, who are talking loudly over the jazz music, laughing, and pushing each other toward the bar for another glass. The scene reminds me of Budapest or Prague right after the fall of the Eastern bloc—except these aren’t Americans and other new tourists enjoying a youthful adventure. They’re locals conversing in Russian and Azeri, out on the town enjoying the fruit of their nation’s burgeoning prosperity.

Despite Ibrahimova’s fears, Baku could never become Dubai. This is an ancient place, not a 20th-century invention. Its layers of history stack up like a pastry. Early one morning I wander through the stillness of the walled Inner City, or Icheri Sheher, much of which was built between the 12th and 16th centuries. I spend a long time gazing at the Muhammad (or Siniggala) Mosque and its minaret, which became known as the Broken Tower after it was bombed by Russian warships in the 1720s (and later rebuilt). When I step back to let a class of preteens in blue and white uniforms file past, I realize that the labyrinth of streets and alleys around me is more than a World Heritage tourist attraction. It’s a living neighborhood.

Most cities value sturdy, handsome buildings over struc-tures that are dilapidated, but I’m wondering if Baku’s mania for restoration has gone too far. “The problem,” says a young woman named Ayan, “is that you can no longer tell what is new and what is old.” Walking around the center of the Old City, I notice walls of apartment buildings with webs of cracks and balconies that appear poised to plum-met to earth. I learn that many are scheduled for a government-subsidized overhaul. Yet the stone of the Muhammad Mosque has been scrubbed to its original golden color, centuries of history wiped away with each swipe of a cloth. The historic oil mansions, too—built in the 1800s with money made from oil, which has been extracted from around Baku since the third century—have been scoured to a generic cleanliness.

View Images Soviet-era oil rigs still operate in Balakhani village, where the industrial boom of Baku started in the late 19th century. Photograph by Rena Effendi

View Images A hulking metal relic of Soviet times stands at the entrance to an old rubber factory in the once thriving Sumqayit quarter. Photograph by Rena Effendi

“Oil made Baku,” Zohrab Huseynov, a mechanical engineer who works in the petroleum industry, tells me one evening as we share a cab. “The reason Baku is big and beautiful and ugly and crowded is because of oil. The most beautiful buildings were erected during the oil boom, as well as communication lines and the first school for girls.”

One luminary whose family made a fortune in Caspian oil was Alfred Nobel, the inventor of dynamite and the benefactor of the eponymous Nobel Prizes. He and others would construct elaborate residences in Baku, including Mukhtarov’s Mansion, a rendition of a Venetian palace that now hosts weddings, and the Hajinski Mansion, which houses luxury shops and apartments. What strikes me, though, is that these residences, refreshed, appear to have been built with today’s oil money rather than a century ago.

I can’t get too exercised about this. A new layer of dirt will come soon enough, and anyway the history of a place transcends its buildings. Late one morning, with wind sending a steady whirl of stray paper fluttering down Sheikh Shamil street, I pass between gold-painted statues to enter the Taze Bey Hammam, a traditional Turkish bath. Opening the wooden front door, I find myself in a hallway decorated with wood carvings, mounted animals, framed photos, and other miscellanea. The place smells like Turkish cigarettes. Taze Bey has operated continuously for more than a century. I check in and trade my clothes for a towel. A film loop of Persian dancing girls fills a screen in the washroom. I catch my breath as I step into the sauna: It’s the hottest I’ve ever felt. “A hundred degrees, one-zero-zero,” the attendant tells me as he places a wet cloth cap on my head—and he isn’t talking Fahrenheit.

Heat, a plunge in cold water, and I’m led into a steam room. I stretch out on a bench covered with a towel. Through mist I see an attendant holding leafy branches under a fountain. When he shakes the branches over me, the water droplets give a shiver of pleasure. He proceeds to rhythmically whip the leaves over my arms and back. I close my eyes and consider the hundreds of thousands of men who over centuries have submitted to the same treatment in this part of the world. I share a language with almost none of them, and many pledged fealty to leaders I would abhor, yet rarely have I felt such a living connection with the past. When the session finishes, it takes me a moment to recall where I am. And who.

“Is that a Volga?,” I ask Elnur Babayev. He nods, then points. “And that is a Pobeda from the 1950s. There also are plenty of Ladas around the city.” The vintage Soviet cars are parked outside the Sirvansah Muzey Restoran, a “museum restaurant” where banqueters dine in a facsimile of a Soviet-era apartment outfitted with 1950s appliances and a framed photo of Stalin. I wouldn’t think enough time had passed, but Soviet chic is in style in Baku. The city’s Intourist hotel, which for five-plus decades accommodated government-supervised tour groups in a featureless building by the harbor, has been faithfully renovated down to its façade of gray. Run by Marriott’s Autograph Collection (and still called Intourist), it offers modern comforts with a touch of wit. Cold dishes in the Soviet-themed restaurant are priced identically at 10 Manat, or around six dollars.

Babayev, a commercial artist, was in his late 20s when the U.S.S.R. collapsed. He moved to the U.S., then returned to Baku in 2007 to help his mother when his father, the esteemed painter Rasim Babayev, passed away. He found a culture he almost did not recognize. Freed from the control of the Soviet Union, an eager Azerbaijan was careering at top speed toward nowhere in particular.

Right now, we’re cruising along the coast just east of Baku to the Abşeron Peninsula, for a night at Babayev’s dacha, a Russian-style country home. I’m envisioning something like England’s green Cornwall peninsula. Instead, we’re navigating rutted roads in a desiccated landscape by the Caspian Sea. When we reach Babayev’s neighborhood, however, he steers us to a handsome cottage. Soon we’re sitting in the dacha’s courtyard, ringed by pomegranate trees and Babayev’s sculptures. He tells me about his father, who was born in 1927 into an educated home with Azeri books written in the prevalent Muslim Arabic script. Within two years the Azeri alphabet would change to Latin characters in an effort to secularize it. The shift lasted a decade, until Joseph Stalin’s government demanded that all offi-cial textbooks and documents be printed in the Russian Cyrillic. When the Soviet Union fell, a rush to Westernize in Azerbaijan saw Cyrillic revert to the Latin alphabet.

“When you change an alphabet, you change history,” Babayev tells me. “You lose your culture.”

View Images A family enjoys downtime with idle Soviet oil rigs at Shikhov beach, 10 miles south of Baku. Photograph by Rena Effendi

The conversation weighs on both of us, so he proposes a swim. We walk the quarter-mile to the highway, which, he explains, had an expansive view until construction of new residences, some thought to be owned by the ruling Aliyev family, shielded it. This also has made beach access more difficult. Babayev shrugs. “We adapt.”

At the end of an alley, beyond a stretch of rocks and sand, is the payoff: the Caspian Sea, considered the world’s largest inland body of water. Around Baku it has been polluted by years of neglect, but here it is translucent.

“Like a thousand years ago,” Babayev says. To the east, somewhere across the blue expanse, is the nation of Turkmenistan. To the northwest, I spot the mountains of southern Russia. I pull off my shoes. The water is chilly, but I duck into its gentle waves and begin to swim

Where to Stay

Brass lamps and velvet sofas give an Ottoman feel to the boutique Sultan Inn; dine at least once in the inn’s ornate restaurant, House of Sultan, framed by stone arches. A budget-friendly choice, Premier Old Gates Hotel cozies things up with Azeri carpets and arabesque wall-paper; upper rooms come with views of the Caspian Sea and Baku’s old city walls. The Fairmont Baku Flame Towers, tucked into one of the city’s three “flame” buildings, exemplifies Azerbaijan’s new prosperity; expect floor-to-ceiling windows and modern decor in the 318 guest rooms.

Where to Eat

Meat dishes are served in Silk Road style at tapestry-filled Manqal. Tiny and always full, Piti-Haneh is a word-of-mouth eatery (look for white-coated servers) known for its pork dishes. Kutab (stuffed flat-bread) and other street foods fill kiosks by the city gates.

What to See

Baku Marionette Theater Azerbaijan’s culture and history come alive in elaborate marionette shows by a troupe founded by artist Tarlan Gorchu and performed in a renovated theater in Baku’s Old City.

Yanar Dag (Fire Mountain) Fires fueled by natural gas emanating from a low hillside on the Abşeron Peninsula have burned for decades. The effect is most dramatic in winter, when days turn dark earlier and crowds are few—ideal for a fireside picnic.

Taza Bazaar Trace Azerbaijan’s legacy as a crossroad of cultures at this indoor-outdoor market selling aromatic spices, dried fruits, cheeses, local teas, and seafood from the Caspian.