DAGDA, Latvia—For nearly three decades, Inara Frolova, a local civil servant, has recorded just how fast this remote district on Latvia’s eastern border has dwindled. When her three brothers, her first husband and her son left for Ireland, she wrote it down. When births hit their lowest-ever level last year, she entered the data.

This year, with its population at roughly half of what it was in 1990, Dagda County was deemed too small to support a local government and merged with a nearby county.

“The only people still around here are retired,” said Ms. Frolova, 59 years old.

Latvia is on the front line of what could become one of the defining challenges for the industrialized world: It is running out of people.

From Portugal to Singapore and across most of the Americas, birthrates are falling, and population growth in the industrialized world has stalled or reversed. That prospect brings with it the specter of a shrinking labor force, an aging population and stagnant economic growth.

In Latvia, that future is already here.

As in much of former Soviet Eastern Europe, Latvia’s low birthrates have been exacerbated by a decadeslong exodus of young people for higher-paying jobs in the West and a reluctance to accept immigrants from outside Europe. The result is a nation whose population is falling even faster than those of other countries, like Japan and Italy, where birthrates are lower.

Abandoned houses, above and below, in Dagda County, Latvia.

Photo: Ian Lovett/The Wall Street Journal

Photo: Ian Lovett/The Wall Street Journal

Since joining the European Union, with its open borders and freedom to work anywhere in the bloc, in 2004, Latvia has lost 17% of its population; only neighboring Lithuania has lost more. The working-age population has fallen 23% over the same period.

Last year, Latvia recorded its lowest number of births in a century and the sharpest population drop in the EU, at 0.8%. This first half of 2021 was worse, with twice as many deaths as births.

Now, this nation of less than two million people is trying to do something that has historically proven all but impossible: Turn around a demographic slide.

This year, the government has adopted new policies aimed at boosting the birthrate and enticing expatriates back, but has so far declined to encourage immigration from outside the EU.

“It’s a very, very serious problem,” Imants Paradnieks, an adviser to the prime minister on demographic issues, said of the falling population. “Latvia is the country of the Latvian people. We want it to remain the country of the Latvian people 100 years from now.”

SHARE YOUR THOUGHTS

What do you think will be the long-term impact of a decline in birthrates? Join the conversation below.

In January, the government adopted a new plan for working with the diaspora, which now numbers roughly 300,000, according to the foreign ministry.

The plan provides funds for encouraging expatriates to invest in Latvian businesses and more than 1 million euros a year, equivalent to $1.2 million, for Latvian language programs abroad, part of an effort to make them feel more connected and, perhaps, draw them back. Money is also allocated for the government to make personalized offers—including help finding work or housing—to families considering returning.

The exodus has slowed somewhat recently, but getting expatriates to return—and to stay—has been difficult. The minimum monthly wage in Latvia is €500, less than a third of what it is in Germany or Ireland. Even last year during the pandemic, when closed borders made emigration challenging, more Latvians left the country than came home.

Matiss Gleglu, 21, returned from the U.S. last year to his family outside Riga, Latvia’s capital. But he struggled to find work and is now preparing to go abroad again.

Former lawmaker Juris Vilums with his son at his former high school, which is closing.

Photo: Ian Lovett /The Wall Street Journal

The urge to leave is only partly economic, he said: As a gay man, he also wants a more progressive social environment. “There’s a lot more old people than young people here, so we don’t have as big of a voice,” he said. “We don’t really get to see the change that we want.”

The exodus is far worse in rural areas, like Dagda, a few miles from Latvia’s border with Belarus.

After the Soviet Union collapsed, so did the local economy, which had relied on factories, collective farms and goods going to and from Belarus. Today, Latgale, the region where Dagda is located, has Latvia’s lowest average salaries and the highest unemployment rate.

Its population has fallen 30% since 2004, with the steepest losses coming after the 2008 financial crisis, when Latvia adopted strict austerity measures.

In Dagda, roofs on empty houses sag. There are no sit-down restaurants left. On the brick facade of one apartment building, a Soviet-era mural proclaims, “Glory to labor.” The air smells of wood smoke, with many homes still heated by wood-burning stoves.

When Juris Vilums, a former member of the Latvian parliament, finished high school here in 2000, there were 11 people in his graduating class. Now, he is the only one left in the area—most of his classmates are abroad and his sister is in Ireland. The high school is closing because there aren’t enough students.

“To stay here, you need some additional patriotism, or a family situation that you can’t leave,” said Mr. Vilums, 39.

Children attend the first day of the new school year at an elementary school in Kekava, Latvia.

Photo: Xinhua /Getty Images

The departure of young people is taking a toll: Latvia has among the lowest per-capita numbers of doctors and nurses in the EU. By 2027, it will lose nearly 90,000 more working-age people, according to the central statistics office, which projects the country will need thousands more medical workers, engineers and craftsmen.

Mr. Paradnieks sees growing Latvian families as the solution. Earlier this year, the legislature nearly doubled the state’s monthly per-child stipend. Families with more children also get discounts on public transit, housing stipends and access to special academic scholarships. Though more support for parents is needed, Mr. Paradnieks said, the percentage of families with at least three children is increasing.

Though Japan has an even lower fertility rate than Eastern Europe, its population isn’t falling as fast because young people don’t move abroad, according to Paul Morland, a visiting demographer at St. Antony’s College, Oxford University. Now, even if Latvia’s birthrate increases dramatically, years of declining population have left a dearth of potential mothers.

A Soviet-era mural in Dagda proclaims, “Glory to labor.”

Photo: Ian Lovett /The Wall Street Journal

“There aren’t that many women, and there are quite a lot of old people,” said Mr. Morland. “You could probably top up numbers on Syrians and Afghans and Russians, but the Baltic countries are very sensitive to their ethnic mix.”

In recent years, Latvia’s neighbors have managed to reverse demographic declines, at least temporarily, in part by increasing immigration.

Estonia has been growing since 2014, largely thanks to an effort to attract high-skilled workers and offer them easy residency. Lithuania has had positive net migration since 2019, and the population ticked up last year for the first time since the Soviet era. Immigration to Poland, largely from Ukraine, now outpaces emigration. Germany would also be shrinking if not for migration.

But Latvia remains resistant to immigration from outside the EU, and net migration has remained negative.

During the Cold War, the Soviet government sent thousands of migrants into the Baltic states, partly with the goal of making them more Russian. That experience left scars, government officials said.

“As a small country, having in our memory 50 years of occupation, we’re always a little afraid of foreigners coming in,” said Elita Gavele, the ambassador to the Latvian diaspora. “It’s better to be the Latvian state, with the Latvian language.”

People relax in the shade in Riga.

Photo: Xinhua/Getty Images

Write to Ian Lovett at ian.lovett@wsj.com