After Russia invaded Ukraine, Anna Gromova, a Russian entrepreneur, made a snap decision to open a real estate agency, hoping to create a safety net from the economic fallout of the conflict. The career change has paid off.

Within weeks, she landed a deal for a stately 18th-century apartment, with parquet floors and high ceilings in the prestigious center of Russia’s former imperial capital of St. Petersburg. Since the war, the owner had stopped coming to Russia, allowing her client to buy it for roughly 40 percent below its current value.

“We in Russia have become accustomed to living in a state of permanent crisis,” said Ms. Gromova, who has bought two investment properties for herself and brokered the sale of 150 others in the past year. Amid the constant shocks, people are looking for “a window of opportunity” to secure their income, she added.

Her business has been underpinned by a state-led spending boom that has propped up the national economy despite the swiftest and most far-reaching campaign of sanctions imposed by Western nations in modern history.

The economic strength has created a sense of well-being among Russians and helped to maintain popular support for President Vladimir V. Putin’s war. But some economists, as well as Russia’s respected central bank chief, have warned that the spending is threatening the country’s financial stability.

The concern is that the government is pumping money into the economy too quickly. As Russia’s invasion has descended into a war of attrition, Mr. Putin has poured the country’s sizable financial reserves into expanding military production, while also showering poorer Russians with higher pensions, salaries and benefits like subsidized mortgages.

“Everyone keeps buying at these subsidized rates,” said Ms. Gromova, 44, who recently finished paying off one of her five existing mortgages. “And who is paying for it? The state.”

The result has been a spike in demand for everything from beach holidays to tank chassis — all of which is fueling inflation. In an effort to prevent the economy from overheating, the central bank in July raised rates more than expected.

The bank expects the Russian economy to grow up to 2.5 percent this year, a faster than normal pace that would allow it to recover practically all economic activity that has wiped out since the start of the war. Unemployment is near a record low and real wages have been growing steadily this year, as state factories and private companies compete for scarce labor.

Russian industrial executives have been boasting to Mr. Putin in public that their plants are raising output to levels last seen in the Soviet era and working around the clock in three shifts to meet the military demand. In St. Petersburg, local textile workshops say they are struggling to find qualified workers and materials to meet a deluge of orders for military uniforms, while in the industrial region of Sverdlovsk, a local tank factory recently has had to contract hundreds of inmates from local prisons to try to meet its targets.

The strong growth figures have upended expectations among some Western officials that the aftershock of going to war would push Russia into a prolonged recession and trigger a popular backlash against Mr. Putin’s government.

As recently as three months ago, Western analysts expected the Russian economy to decline 0.9 percent this year, according to a survey of 19 investment banks and other research institutions compiled by the British firm Consensus Economics. This month, their mean projection has swung to 0.7 percent growth.

Lending has expanded rapidly since the invasion, as the government has sought to stimulate growth and bolster military output. Corporate loans increased 19 percent in the year to June, according to the Russian central bank’s figures.

The combined value of mortgages handed out by Russia’s top 20 banks rose 63 percent in the first half of this year, according to the state-run lender, Dom.RF, and the real estate research firm Frank Media. In the first three months of the year, one out of every two new mortgages was subsidized by the state, through various social programs that provide loans to first-time buyers, including soldiers, at preferential interest rates.

“You can serve and not have to think about much, because you will have a guaranteed home of your own,” a Russian soldier with the call sign Domovoi said in a video recorded by the Defense Ministry this month, referring to subsidized mortgages.

The impact of public spending has been particularly pronounced in poorer regions on the periphery of the country that provide the bulk of military production and soldiers. Regions bordering Ukraine and the occupied Crimean Peninsula have also benefited economically from major investments in military fortifications and the arrival of tens of thousands servicemen, even as residents have suffered from nearly daily retaliatory Ukrainian rocket and drone attacks.

Soldiers are sending home salaries that usually outstrip average local earnings several times. Families of those who die collect compensation that can surpass their annual income.

Much of that money is poured back into local economies, as sanctions have limited Russians’ ability to travel overseas. Hospitality spending in Russia rose 12 percent in the first four months of this year, compared to the same period in 2022, according to an analysis of official statistics by the Russian geographer Natalia Zubarevich; in Crimea, spending in bars and restaurants more than doubled.

When the bridge linking Crimea to Russia came under attack earlier this month, a traffic jam made up primarily of Russian tourists heading to the occupied peninsula stretched for more than five miles, according to local media.

“For some, it’s a new adventure,” said a Russian state news anchor as she described how tourists had to switch to a ferry after an explosion collapsed part of the bridge, killing a family. “On the sea you can take photos and enjoy the views.”

The economic high may not be sustainable.

The expansion of spending and the decline of Russia’s oil and gas revenues have pushed the nation’s budget into deficit.

In the first five months of the year, Russia’s federal government spent in nominal terms nearly 50 percent more than in the same period of 2021, according to calculations by the Moscow-based Gaidar Economic Institute.

The country’s energy revenues from January to May have halved compared to the same period last year, as sanctions forced Russia to sell its oil at a discount and European nations slashed purchases of Russian natural gas.

The recovery is also severely constrained by Russia’s chronic worker shortage, a problem that Mr. Putin has few means of solving.

Mr. Putin’s decision to mobilize 300,000 men for the front has removed many blue-collar workers from the economy. Hundreds of thousands of predominantly white-collar Russians have left the country in protest of the war or to avoid mobilization. And even before the war, the population was in a long-term decline.

Despite the rising wages, Russia has been unable to cover the worker shortage with migrants, as sanctions have reduced their ability to send earnings home.

In announcing the recent rate hike, Elvira Nabiullina, the central bank governor, repeatedly mentioned labor shortages in guarded remarks to the press, a sign of her concern with the scale of the problem. She also said the demand for goods and services was outstripping supply, feeding inflation and threatening financial stability.

“As an economist, I don’t know how this bubble can be deflated,” said Alexandra Prokopenko, a researcher at the Carnegie Russia Eurasia Center in Berlin, and a former adviser at the Russian central bank. “One day it could all crash like a house of cards.”

Alina Lobzina contributed reporting.