(CNN) — Whether you find yourself in a no-frills kocsma filled with beer-swilling old timers, an elegant cocktail lair or one of Budapest's quirky ruin pubs jammed with tourists, the Hungarian capital's drinking scene has one constant.

Countless times throughout the night, the bartender will reach for the same distinctive, round-bellied bottle.

The inky, amber-tinted liquid inside is called Unicum, and with roots that delve back to the late 18th century, it's one of the most revered national drinks in Hungary

Like that other boozy Hungarian favorite, the fruit brandy pálinka, Unicum is largely savored as an aperitif or a digestif in shot form.

Produced by Budapest based beverage company Zwack, it's a herbal liqueur comprising a secret blend of more than 40 herbs and spices aged in oak.

Less aggressive than Fernet yet beefier than Jägermeister, thick, bitter Unicum, laced with subtle piney eucalyptus notes, is indeed bracing, a taste that grows delightfully more palatable with each sip according to Unicum brand ambassador Csaba Gulyás.

"It's a bittersweet potion, which isn't easy to enjoy the first time, but then you cross that barrier and it becomes your favorite," says Gulyás.

Related content What to eat in Hungary: Your guide to goulash and more

Royal origins

Unicum was originally created to cure Habsburg ruler Joseph II of a bout of indigestion. Courtesy of Zwack Unicum

The story behind how Unicum came to be is equal parts fabled and turbulent.

Its distinctive bottle flaunts a gold cross that pops against a red background -- the first hint that its roots are medicinal.

It all began in 1790, when Habsburg ruler Joseph II, Holy Roman Emperor, had a bout of indigestion, and Dr. Zwack, royal physician to the Imperial Court, whipped up a herbal remedy for him.

Upon drinking it, Joseph II purportedly exclaimed, "Dr. Zwack, das ist ein Unikum!"

The "unique" elixir subsequently spread in popularity, and the Zwack company was founded in 1840 by József Zwack, an entrepreneurial descendant of the visionary doctor.

By 1895, Zwack was producing over 200 liqueurs and spirits, exporting them from a distillery that's still in use today.

Different generations of the Zwack family have always presided over the business and two of its most prominent characters are brothers Béla and János, who were at the helm during Zwack's most troubling years.

The 1930s ushered in an era of turmoil, what with the Great Depression and prohibition in the United States, leading to a decrease in demand for Zwack products.

During World War II the factory was destroyed and shortly after, communism forced the company to nationalize. However, the Zwacks hatched a plan, creating a fake recipe for the communists to use.

János found safety in the United States, while Béla stayed put at the distillery until the mid-1950s, when he decamped to Italy and started tinkering with the original Unicum again.

After Communism fell in 1989, the Zwacks bought their company back and the true, heady Unicum recipe was embraced, János's son Péter reviving the name both domestically and abroad.

"Everybody has a personal story with Unicum. It has spiritual content and it's timeless, surviving our history," explains Gulyas.

"I think I would love Unicum even if I didn't know anything of its heritage, but once you get the whole picture, wow," says Dez O'Connell, a bar consultant who oversees all the beverage programs for Budapest's BrodyLand portfolio, including the events hub Brody Studios.

"Unicum is the story of Hungary politically and socially since the Hapsburg Empire to the present day. That of course gives it a special place in most Hungarian hearts and stomachs."

A symbol of unity

The liqueur is now one of Hungary's most revered national drinks. Courtesy of Zwack Unicum

A fixture on Budapest bar shelves, Unicum is best enjoyed while in the company of friends and family, attesting to the importance Hungarians place on convivial, food-fueled social gatherings.

Ferenc Varsányi, partner at the cozy barber shop turned cocktail den Hotsy Totsy, adds that "it brings families together. Hungarians don't drink Unicum just on special occasions. It's a symbol of unity."

It's most likely to consumed as a room temperature shot, but Varsányi prefers drinking it from a tasting glass, "letting it rest a bit to express the depth of flavors and the enormous spice."

He also relishes it chilled, straight out of the freezer, but says it particularly hits the spot in hot weather when served on the rocks.

However, O'Connell recommends drinking Unicum alongside a pilsner.

Because of its intensity, Unicum "is not the most obvious of cocktail ingredients," notes O'Connell who uses it sparingly, integrating a spoon or two into drinks that lend themselves to a bit more texture.

Likewise, Varsányi sometimes swaps it in as a bolder alternative to Campari or weaves it into hot toddies.

Home bartenders, however, should seek out two cocktail friendly Unicum variants: Szilva and Riserva.

The former is made by macerating plums in casks that once held Unicum, the latter is aged twice, the second time in barrels that formerly housed Hungary's prized sweet Tokaji Aszu wine.

"The bitter notes are dialed down, replaced with fruitier, oakier flavors," O'Connell points out.

For instance, the Kollázs bar at the Four Seasons Gresham Palace Hotel Budapest offers the Puszta Reloaded, a riff on a traditional Hungarian cocktail made with Tokaji wine, apricot brandy, and herbal liqueur.

A refreshing sweet and sour libation, it marries Unicum Riserva with unripe grape juice.

"We recommend this drink to our guests who would like to experience Hungary through its classic flavors," says bartender Attila Farmasi.

While Unicum can be appreciated in almost any Budapest bar, perhaps the most fitting backdrop is at its historic distillery, located close to the Danube in the gritty District IX.