World-leading zoologist Ilya Mechnikov wasn’t safe in the city of Odesa. The soldiers were breaking up protests. Students had gone missing. And the local police chief had put Mechnikov on a list of “politically untrustworthy” individuals. He decided it was time to leave. On 22 May 1882, Mechnikov handed in his resignation letter to the rector of the Imperial Novorossiya University (at the time in the Russian Empire, now Odesa National University in Ukraine), and left the country1.

Following the assassination of Tsar Alexander II in March 1881, scientists in the Russian Empire faced increasing oppression. Anyone vaguely suspected of ‘disloyalty’ to the Tsar was arrested or forced to resign. Mechnikov escaped to the Italian island of Sicily, where he continued his research on marine biology. In 1883, once the political situation in Russia had calmed down, Mechnikov returned to Odesa and delivered a paper on what he called the phagocyte theory. This laid the foundations of modern immunology, and later won Mechnikov the 1908 Nobel Prize in Physiology or Medicine, shared with the German scientist Paul Ehrlich. But the political threats did not go away. Ultimately, Mechnikov resettled in Paris, where he worked until his death in 1916.

Since Russia’s war on Ukraine began in February, how to rebuild science in the invaded country has been much discussed. There are questions over what to prioritize, whether the existing system needs reform and how the international community can best support scientists in Ukraine2. A better understanding of the history of science can help to plan for the future.

The placement of Ukraine at the borderlands of the Russian and Soviet empires created opportunities for scientists from diverse backgrounds, ethnicities and religions. Yet, those scientists often faced violent conflict and political oppression. The fact that Ukraine has been a crucible for defining what scientific freedom really means has fuelled some incredibly creative and original science. It has also generated a culture of resilience.

Civil-war scientists

Following the Bolshevik Revolution of 1917, the Russian Empire collapsed into civil war. In Crimea, the quantum physicist Yakov Frenkel — a committed revolutionary — was captured and imprisoned by the anti-revolutionary White Army, which was fighting the Red Army of the Bolsheviks. Stuck in prison, Frenkel began to think about what it really meant for an electron to be ‘free’. Electrons were “not free in the real sense of the word”, he argued. The flow of electricity could be better explained, Frenkel realized, by imagining electrons as part of a “collective excitation” — what we now call quasiparticles. The chaos of war and revolution sparked ideas that transformed existing understandings of quantum mechanics3.

After the civil war ended in 1923, science again flourished in Ukraine, especially in Kharkiv, the capital of the Ukrainian Soviet Socialist Republic until 19344. Several important scientific institutions were established, including the Ukrainian Institute of Physics and Technology in 1928. And although the Bolsheviks resisted Ukrainian independence, early revolutionary culture created a space for national identity to be celebrated, with the hope that Ukrainian science would be “national in form, socialist in content”5.

High angle view of an assembly line for computers at the Institute for Cybernetics of the Ukraine Science Academy in 1971

A 1971 computer assembly line at the Institute of Cybernetics in Kyiv, where researchers had planned an automated network sometimes called the Soviet Internet.Credit: M. Nachyinkin/akg-images/TT News Agency

A number of scientists in Ukraine saw their work as part of wider nation-building. These included the pioneering psychologist and pedagogue Ivan Sokolianskii. In the aftermath of the civil war, Sokolianskii established a school for children who were deafblind in the Kharkiv Institute of People’s Education, arguing that children with disabilities — including those disabled during the conflict — needed to be taught as part of the “shared activity” of nation-building. Sokolianskii was adamant that these children should gain an appreciation of their native Ukrainian language, something that later brought him into conflict with the Soviet authorities6.

Stalinist purges

Throughout the 1930s, science was increasingly expected to conform to Marxist–Leninist ideology, and tolerance for a separate Ukrainian national identity decreased7. Repressions of the Ukrainian people included the famine known as the Holodomor, instigated by the Soviet state, which killed several million people between 1932 and 19338.

Joseph Stalin, who had consolidated his leadership of the Soviet Union, initiated a wave of arrests and executions between 1936 and 1938. Scientists in the Ukrainian Soviet Socialist Republic (SSR) were often targeted. The sociologist Semën Semkovskii was executed in Kharkiv in 1936, accused of supporting “bourgeois idealism” after claiming that Albert Einstein’s theories of special and general relativity were compatible with Marxism9. The physicists Lev and Olga Shubnikov, a married couple who worked together at the Ukrainian Institute of Physics and Technology, were also arrested. Lev was tortured and forced to sign a confession stating that he was “a member of a Trotskyist sabotage group” before being executed. Olga was spared only because she had recently given birth to the couple’s first child10.

Yet despite such severe repression, which was soon followed by the upheavals of the Second World War, scientists in the Ukrainian SSR did their best to keep going. The physicist Antonina Prykhotko defended her PhD in 1943 in Ufa, in the Ural region of Russia, where the Ukrainian Institute of Physics and Technology had been evacuated. After the war, she joined the Institute of Physics in Kyiv, where she pursued her research in low-temperature spectroscopy (see go.nature.com/3pu2nnx).

Science after Stalin

After the death of Stalin in 1953, the new Soviet leader, Nikita Khrushchev — the former head of the Communist Party in the Ukrainian SSR — reduced the ideological pressure on scientists11. Among those who made the most of this period of relative freedom was the director of the Institute of Cybernetics in Kyiv, Viktor Glushkov, a pioneer of early computer networks12. Between 1962 and 1970, Glushkov and his team mapped out the specification for the All-State Automated System, sometimes referred to as the Soviet Internet. Glushkov believed that an automated computer network could implement the principles of a socialist command economy, but without an authoritarian leader. He and his colleagues even dreamed up a fictional country, Cybertonia, in which the computer network replaced the socialist state. However, the Politburo in Moscow did not like the idea of being replaced by a computer, and so refused to fund Glushkov’s project after 197013.

Meanwhile, Soviet money went increasingly towards weapons and nuclear-power plants — many of which, including Chernobyl, ended up in what is now Ukraine. Less and less went towards fundamental scientific research. The imprint of the Soviet Union’s bureaucracy could still be felt as Ukraine struggled to reform its scientific funding and infrastructure after gaining independence in 199114.

In the face of the ongoing Russian invasion, scientists in Ukraine and their supporters have exercised perseverance and creativity to continue to work, in their own country and elsewhere. Students are attending university courses, even if they are often forced to log in remotely from a bomb shelter or basement. That attitude is to be expected. Ukraine’s history has been punctuated by violent conflict and political repression, which has fuelled a scientific culture defined by resilience and creativity. Investing in the people of Ukraine, and drawing on this diverse culture, will be crucial for the future of science in the country.