The US has had to pay the highest interest rate in 25 years to sell its government bonds amid concerns about the country's debt load and rising inflation.

At an auction of $25 billion in 30-year Treasury bonds on Thursday, yields reached as high as 5.22 percent, the US Treasury Department said. That is the highest since the 5.52 percent yield in August 2001, the last time the US had a budget surplus.

Last year, the US had a budget deficit of $1.85 trillion, or about 6.3 percent of GDP, a shortfall that the government has to make up by borrowing through the sale of Treasury bonds to pay for government programs.

"All in all this is problematic for the Treasury. They have to fund the government at more expensive levels," Gennadiy Goldberg, head of US rates strategy at TD Securities, was quoted as saying by the Financial Times.

The yield on 30-year Treasurys in a July auction was 5.06 percent, while it was 4.91 percent before Trump's second term began.