UBS has suggested investors buy both government bonds and equities despite a sharp global sell-off in government debt triggered by inflation fears stemming from the war in the Middle East.

Recent rises in bond yields have created an “appealing risk-return profile” for short- and medium-dated high-quality bonds, UBS chief investment officer Mark Haefele said, with the bank also maintaining a positive outlook for global stock markets.

“While near-term yield volatility may keep markets on edge, current attractive yields and growth risks point to an appealing risk-return profile for short- and medium-maturity quality bonds,” Haefele said, also recommending investors maintain diversified exposure to equities across sectors and regions.

Markets have been rattled as the closure of the Strait of Hormuz pushed up oil and gas prices and intensified concerns about inflation.

UK 30-year government bond yields hit a 28-year high, while equivalent German borrowing costs climbed to their highest level in 15 years. In the US, the 30-year Treasury yield rose above 5.1%, its highest level since the 2007 credit crunch.

Investors are increasingly betting that central banks may need to keep interest rates higher for longer, with markets now pricing in another Federal Reserve rate rise over the next year.

“Yield volatility is likely to pick up further the longer the Strait of Hormuz remains closed, with markets pricing the upside risks to inflation and tighter monetary policies across the world,” Haefele said.

“But we maintain the view that quality bonds offer an appealing risk-return profile given the two-sided risks on inflation and growth. We also do not expect higher yields to derail the current equity rally.”

UBS also argued that fears over government borrowing and fiscal credibility were likely to prove manageable in major economies.

Looking at the UK, the bank said it believed the chances of any future government pursuing an aggressive spending agenda that destabilised bond markets were low, while Japanese ministers are expected to unveil a fiscal consolidation plan within the next month, where stronger tax revenues should help improve public finances.

UBS sees higher bond yields beginning to attract fresh investor demand soon, helping stabilise markets after recent volatility.

Although recent US Treasury auctions saw softer overall demand, UBS noted that foreign investors remained active buyers of long-dated debt, suggesting international funds were moving to lock in more attractive yields.

“With shorter-dated yields becoming appealing relative to cash or deposits, we believe this could create an anchor for yields and limit some upward pressure,” Haefele said. UBS added that capital markets still had “sufficient capacity” to absorb rising government debt issuance.