Since ancient times, societies have attempted to separate people with disease from those who remained unaffected, with references to self-isolation dating back to the Old Testament. As Covid-19 sweeps across the globe, we are advised to “self-quarantine” if we have recently returned from a part of the world where the virus is rapidly spreading, or if we have knowingly come into contact with an infected person. To understand the importance of self-quarantining during this modern-day pandemic, it’s helpful to look back to the history of the word “quarantine” itself, which traces its origins to medieval Europe.

Two linked trade ports Like Venice, Dubrovnik (formerly Ragusa) has always been a city popular with travellers from around the world; today, both are Unesco World Heritage sites. During medieval times, Venice and Ragusa were powerful trade ports with intertwined histories: Ragusa recognised Venetian suzerainty from 1205 until 1358, but still retained much of its independence. In 1420, when Dalmatia (a coastal region bordering the Adriatic Sea, now mostly in present-day Croatia) was sold to Venice, Dubrovnik remained a free city in all but name.

The word “quarantine” has Italian roots: in an effort to protect coastal cities from the Black Death ravaging 14th-Century Europe, ships arriving in Venice from infected ports were required to sit at anchor for 40 days (quaranta giorni) before landing, a practice that eventually became known as quarantine – derived from ‘quarantino’, the Italian word for a 40-day period.

In 1374, a proclamation was issued in Venice that stated all ships and passengers had to be stationed on the nearby island of San Lazzaro until the special health council gave them permission to enter the city. “This led to the discrimination of ships and travellers from certain countries as well as other wrongdoing that was occurring in Venice regularly,” writes co-author Ante Milošević, PhD, in Lazaretto in Dubrovnik: The Beginning of the Quarantine Regulation in Europe.

Across the Adriatic Sea in Ragusa (present-day Dubrovnik, Croatia), however, the city’s Great Council passed a ground-breaking law in 1377 to prevent the spread of the pandemic requiring all incoming ships and trade caravans arriving from infected areas to submit to 30 days of isolation. The legislation, Veniens de locis pestiferis non intret Ragusium vel districtum (“Those arriving from plague-infected areas shall not enter Ragusa or its district”), stipulated that anyone coming from pernicious places must spend a month in the nearby town of Cavtat or the island of Mrkan for the purpose of disinfection before entering the medieval walled city. “Hence, Dubrovnik implemented a method that was not only just and fair, but also very wise and successful, and it prevailed around the world,” Milošević writes.

Isolation and discipline are the two important things

Co-author Ana Bakija-Konsuo, MD-PhD, added that Dubrovnik was the first Mediterranean port to sequester people, animals and merchandise coming from infected areas by sea or land, keeping them separate from the healthy population, while Venice stopped all ships and trade, halting life in the city. The Ragusan Republic imposed very strict punishments and fines for offenders who did not follow the 30-day quarantine law (trentine, as the term was written in a document found in the Archives of Dubrovnik, dated 27 July 1377). In the beginning, quarantine was 30 days, but it was eventually prolonged to 40 days as in Venice.

No-one knows exactly why the isolation period was changed from 30 to 40 days: some suggest 30 days were deemed insufficient to prevent disease spread, as the exact incubation period was unknown; others believe the 40-day quarantine was related to the Christian observance of Lent; and still others believe the 40 days is based on biblical events like the great flood, Moses’ stay on Mt Sinai, or Jesus’ stay in the wilderness. Venice made the 40 days official in 1448, when the Venetian Senate added 10 days to the 30-day quarantine rule for ships entering its port.

In Lazaretto in Dubrovnik, Bakija-Konsuo writes that Dubrovnik’s administration arrived at the idea of quarantine as a result of its experience isolating leprosy victims to prevent spread of the disease. Throughout its history, Dubrovnik was ravaged by numerous diseases, with leprosy and plague posing the largest threats to public health.

You may also be interested in:

• How to make pizza like a Neapolitan master

• Dalmatia’s “fjaka” state of mind

• The cheese flavoured by wind

“Historical science has undoubtedly proved Dubrovnik's priority in the ‘invention’ of quarantine,” Bakija-Konsuo said. “Isolation, as a concept, had been applied even before 1377, as mentioned in the Statute of the City Dubrovnik, which was written in 1272 and where is the first mention of the isolation of the patients with leprosy. This Statute is among some of the oldest Croatian written legal documents.”

Bakija-Konsuo added that according to the Bible, Lazarus who suffered from leprosy was proclaimed the patron saint of lepers, and the shelters for them were named after him and called lazarettos. After Ragusa set up Europe’s first temporary plague hospital on the island of Mljet, quarantine facilities throughout Europe eventually became known as “lazarettos”.

Bakija-Konsuo said that following Ragusa’s 1377 isolation legislation, quarantine was first implemented in Cavtat, a small town located south-east of Dubrovnik, and on nearby islands (Supetar, Mrkan and Bobara). “Initially, quarantine accommodation was poor, improvised, in huts, tents, and sometimes in the open air. The benefit of huts was that they could easily be burnt down as a disinfection measure,” she said. In 1397, a decision was made to establish a quarantine in the Benedictine Monastery on the island of Mljet. The lazaretto at Danče was constructed in 1430, and subsequently, a larger and more modern lazaretto was built on the island of Lokrum.

On 12 February 1590, the Dubrovnik Senate decreed that the last lazaretto was to be built at Ploče, the Old Town’s eastern entrance. Construction of the lazaretto complex was finished around 1647; in 1724, the Senate proclaimed it to be an integral part of the city’s fortifications.

“The Lazaretto preserved its original function long after the fall of the Dubrovnik Republic, but we do not know the year when it was abolished as a healthcare institution; according to archival records from National Archives in Dubrovnik, it was around 1872,” Bakija-Konsuo said. “This impressive stone building represents not only a unique architectural complex, but also an institution that best describe[s] the rich medical heritage of the old Dubrovnik.”

The Lazarettos of Dubrovnik, today a tourist attraction that host cultural events such as concerts and traditional Linđo (Lindjo) folklore dancing, are a reminder of the city’s foresight in combating infectious diseases centuries ago.

Ivan Vuković Vuka, a historical tour guide in Dubrovnik who was born and raised in the city, recalls going to the Lazarettos for clubbing and open-air concerts on hot summer nights just to feel some breeze. The Lazarettos (locally called “Lazaret” or “Lazareti”) are situated approximately 300m outside the Old Town’s regal stone walls. “Inside the city walls any kind of sickness can be spread easily, so Lazareti facilities are very wide and spacious areas divided in 10 multi-storey buildings so there is always enough air,” he said, noting the breath-taking views of the Old Town harbour.

The Lazaretto complex consists of 10 lazarettos, five courtyards and two guardhouses. According to Lazaretto in Dubrovnik co-author Vesna Miović, PhD, all travellers who had come from suspicious (infected) areas were housed above the porticos, on the floor with a roof structure and barred windows, and in houses on the Lazaretto plateau (also called “the upper lazaretto”). Quarantined travellers could walk freely across the plateau and even had little terraces where they could take in a breath of fresh air, but they were forbidden to mix with those who had already been released from quarantine or anyone who lived outside the Lazaretto complex.

With the city presently under quarantine due to Covid-19, tourism – the lifeblood of the Croatian economy and one of Dubrovnik’s main income streams – has come to a halt. All cruise ships are suspended through June, and on 19 March 2020, Croatia implemented a temporary ban of transit through border crossings to help prevent the spread of the virus. “For now, all the borders are closed – in Croatia you cannot even commute between cities,” Vuković Vuka said. American Airlines cancelled its nonstop flights from Philadelphia to Dubrovnik for all of 2020, a new route initiated just last year and the first direct flight connecting the United States and Croatia in 28 years; other European and international carriers have suspended flights through June.

After overtourism, he said, now there is ‘undertourism’

“Even during ‘90s warfare, Dubrovnik was not that empty,” Vuković Vuka said. “You can hear the silence and even the minor sound echoes over the cobblestone.” After overtourism, he said, now there is “undertourism”.

Dalmatians, like their Mediterranean neighbours, are social beings who love to converse and linger over coffee at cafés. “Covid makes Croatians crazy, we like to hug and kiss each other like Italians and Spanish,” Vuković Vuka said. “We make jokes that this is actually our café bar rehab.”

Unlike Dubrovnik’s former quarantine law, today, people have the option to self-quarantine in the comfort of their homes; however, “[the] problem of people in Dubrovnik is that they also live in big communities with their parents and grandparents, so they have to take care not to get infected because of [the] old generation,” Vuković Vuka said.

Other than that, not much has changed in the last 600 years regarding the protocols of quarantine, which Dubrovnik has implemented many times over the centuries and serve as a reminder in these present times: “Isolation and discipline are the two important things,” he said.

Join more than three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "The Essential List". A handpicked selection of stories from BBC Future, Culture, Worklife and Travel, delivered to your inbox every Friday.