(Bloomberg) -- Mortgage rates in the US climbed for the second week in a row, hitting the highest level in three weeks.

The average for a 30-year, fixed loan rose to 6.9% from 6.81% last week, Freddie Mac said in a statement Thursday.

Buyers are confronting a tough housing market in many parts of the US. Mortgage rates have been hovering close to 7% in recent weeks and prices have crept higher as inventory remains tight. That’s made it even harder for first-time buyers to crack into the market.

Fitch Ratings’ downgrade of US government debt earlier this week sent yields on Treasuries to fresh 2023 highs. Payroll data this week pointed to strength in the economy.

Read More: Homeowners in US Who Want to Move Can’t Find Anything to Buy

“The combination of upbeat economic data and the US government credit rating downgrade caused mortgage rates to rise this week,” Sam Khater, Freddie Mac’s chief economist, said in the statement.

©2023 Bloomberg L.P.