By Anna Isaac

Foreign investors are piling back into Russian bonds, attracted by high yields and the country's relatively strong finances compared with emerging-market peers.

Despite a heavy reliance on oil exports and tense relations with the West, investors say yields on Russian government bonds are attractive given its ability to withstand oil-price volatility. Russia marked its eighth straight week of inflows into its bonds on July 23, according to data from fund tracker EPFR Global, only outdone by China.

"Russia's ruble bonds have extremely high real rates, once you adjust by macroeconomic fundamentals," said Joseph Mouawad, a fund manager in the international bonds team at Carmignac. "Russian debt is actually one of our favorite EM debts at the moment."

Compared with emerging-market peers, Russia has relatively low government debt measured as a percentage of gross domestic product. It has also built up its central-bank reserves in recent years. Analysts say the central bank is in a stronger position to manage its currency despite the country's heavy reliance on oil exports, allowing the ruble to fall in value and adjusting interest rates to combat inflation.

Russia's recent strong performance comes after an oil-price feud waged by Saudi Arabia sank the price of crude and left a huge hole in the kingdom's finances. Saudi Crown Prince Mohammed bin Salman upended the oil market in March by saying he would flood the world with crude, even as measures to contain the pandemic limited demand. Now, some analysts say Russia is better placed to weather the twin shocks of the oil price slump and the pandemic.

"We've been generally positive on Russia over the past year or so," said Kaan Nazli, economist and portfolio manager at Neuberger Berman. "Mainly because, although they're not orthodox on foreign policy, they're pretty serious on economic policy."

Nonresidents bought $1.3 billion of Russian debt in April, according to data from the Institute of International Finance, a group representing more than 400 of the world's biggest banks. Most others, such as Mexico, Turkey, and Brazil were still stemming outflows for the same month.

Real yields, which reflect the value of bond yields after adjusting for inflation expectations, have plunged as the world's central banks slashed interest rates and unleashed stimulus to address the pandemic. In many developed economies, real yields on sovereign bonds have touched record lows or turned negative.

The yield on the benchmark 10-year Russian bond is 5.8% according to FactSet. Meanwhile, inflation in the country is running at around 3%. Few emerging markets offer similar real yields and of those, most carry greater risk, in investors' view.

An effort to make Russia's central bank more credible has paid off, investors said. It has brought inflation under control, and authorities have held regular calls with nonresident investors to explain their approaches to supply and demand for ruble bonds and Eurobonds, analysts and investors said.

"They've had this saving mentality. They've been saving for a rainy day, and now it's arrived," said Jasper Wright, an analyst at Federated Hermes which holds Russian bonds.

Nonresidents held 30.6% of domestic Russian bonds through July 1, according to figures from the Russian central bank, down slightly from June after three straight months of gains from March. The amount in billions of rubles held by nonresidents has steadily risen throughout the year, even amid increased issuance.

Unlike some Middle East oil exporters, which have currencies pegged to the dollar, Russia has a mostly floating exchange rate. Investors say this has helped the country to adjust to shifting oil prices.

"If your main commodity is priced in dollars, having that flexibility allows your currency to depreciate. Your oil revenue in the budget doesn't change. If you compare it to the Gulf, to Saudi [Arabia], a 40% oil-price decline there is a 40% drop in their revenues because their exchange rate is pegged to the dollar," said Mr. Nazli.

Still, some investors see potential risks if Russian debt issuance picks up pace. While the flexibility of the ruble can be good for the economy, it can also hurt returns. This year's 16% fall in the ruble would more than wipe out the 5.8% yield on the bonds for foreign investors who convert their holdings back into dollars.

For now, though, that risk is bearable for many investors.

Write to Anna Isaac at anna.isaac@wsj.com