Pastel de nata—the slightly burnt pieces are the best part. Courtesy Nata & Co.

Small, crumbly, with a bright yellow color and a slightly burned top, Portugal’s rustic pastel de nata—custard tart—is often near the top of foodies’ travel guides. But the flaky pastry also has a history as its country’s unlikely savior.

In the years following the international financial crisis of 2008, the Portuguese government was desperate to repay billions of euros of foreign debt. Years of bad investments and fraud-like negotiations had left the country’s banks highly indebted to Spain and Germany. As economists brainstormed for solutions, Álvaro Santos Pereira, the former economy minister, hit on a maverick suggestion in 2012: selling the country’s most traditional sweets to save the economy.

“Why isn’t there a well-known Portuguese custard tart franchise yet?” asked Pereira, who had visions of a global chain that would be as popular as the Nando’s Portuguese flame-grilled chicken restaurants that have expanded to 16 countries.

It was headline heaven for journalists. The small, bright yellow pastry with a slightly burned top, also known as the pastel de nata, was somehow expected to carry the country on its flaky shoulders. The critics came out.

Simple ingredients—pretty much just sugar, flour, eggs and butter Courtesy Nata & Co.

“The drought will end, dams will all fill-up, water will flow, and custard tarts will be exported,” wrote the satirical news website, Inimigo Público, mimicking the minister’s positivity later on.

“People laughed in Portugal, but Santos Pereira was not being ridiculous,” says Filipe Brito, a Portuguese baker in England. “The pastel looks rustic but with a buttery, crisp pastry that hides a subtle egg custard, our tart wins over the global palates.”

Right before Santos Pereira made his plea, Brito had just opened Nata & Co, a pastry shop named after the tarts, in Cardiff, U.K. Since then, Nata & Co has opened two other branches and is going strong.

Despite the naysayers, the buzz following the former economy minister’s comment boosted small businesses with international ambitions. NATA Lisboa, a Lisbon-based franchise starting up at the time, now has stores in the UK, France, Austria and even the United Arab Emirates.

The line down the block at Antiga Confeitaria de Belem Courtesy Antiga Confeitaria de Belem

Investing in Portugal’s bakery exports is proving to be profitable, bringing in 191 million euros in 2015 according to the latest reports by market researcher Informa D&B.

But the tarts’ success should not have come as a surprise to anyone. It wasn’t the first time that the Portuguese had turned to the pastel de nata to bail it out of a financial hardship.

In the years following the Liberal Revolution of 1820, one that saw an end to religious orders and resulted in the transition to a constitutional monarchy, the Jerónimos monastery in the Belém district of capital Lisbon was shut down.

Its monks and workers were forced to look beyond their traditional vocations to sustain themselves. In an attempt at survival, someone from the monastery offered his own version of custard tarts for sale in a shop close-by. Those pastries rapidly became known as ‘Pastéis de Belém’.

Almost two centuries later, their heirs carry forward their legacy in Antiga Confeitaria de Belém, Portugal’s huge flagship bakery recommended in tourist manuals worldwide for having the best custard tarts around.

Belem bakers at work are on view at the popular spot. Courtesy Antiga Confeitaria de Belem

“We sell an average of 20 thousand pastéis de Belém a day,” says one of the current owners, Miguel Clarinha. “The number has been growing in the past three to four years in part thanks to the rise of tourism in Portugal and, specifically, Lisbon.”

MA research carried out in 2015 for Portugal’s School of Economics and Management (ISEG) on tourists’ custard tart consumption in Antiga Confeitaria de Belém shows that the visitors have often tasted some form of a Portuguese custard tart before.

“Of course, their popularity can attract tourists to Portugal, but it is also important that tourists try the tarts while they’re here so that they want to continue buying them when they return home,” said Professor José Adelino, a lecturer at one of Portugal’s top business schools, Católica Lisbon.

Mr. Victor Lopez stirs up Antiga Confeitaria de Belem’s secret formula before baking begins. Courtesy Antiga Confeitaria de Belem

Macau, which used to be a protectorate of Portugal, has been selling an ‘egg tart’ variation of the pastel de nata in its KFC fast food branches for over a decade. And Portugal’s now-popular NATA Lisboa franchise opened its latest branch in Abu Dhabi in 2015.

“It answers a lot of people’s questions about whether we could sell our products anywhere in the world,” said founder José Campos in an interview with Portuguese financial portal Dinheiro Vivo.

Santos Pereira may have been laughed at, but his comment allowed Portugal to realize its tart’s potential.

Gastro Obscura covers the world’s most wondrous food and drink.

Sign up for our email, delivered twice a week.