Mortgage rates have pushed past 4% for the first time this year.

The average rate for a 30-year fixed-rate mortgage increased to 4.03%, from 3.94% last week. A year ago, the rate was 3.95%.

Rates have been moving higher since Donald Trump was elected president.

The interest rate on the U.S. government's 10-year Treasury note has climbed to 2.38% on Wednesday from 1.85% on Election Day. Treasury notes serve as a benchmark for various types of credit, including mortgages.

Higher interest rates make it more expensive to borrow money.

Related: How much house can you afford?

"People are anticipating some economic stimulus in the first few months of Trump's presidency on infrastructure and military spending and tax cuts that could lead to faster inflation," explained Lawrence Yun, chief economist for the National Association of Realtors. "Mortgage rates are responding to the potential of higher inflation in 2017."

The Federal Reserve is scheduled to meet in December and is expected to increase the federal funds rate, which is the short-term interest rate it uses to lend money to financial institutions.

"People are anticipating [the Fed] will be raising rates very soon," Yun said. "The mortgage rate is running ahead of that decision."

Mortgage rates have not been above the 4% since December 2015, but they are still relatively low compared with historic levels.

Related: What will your mortgage payment be?

But because a rise in rates increases the cost of borrowing money, it can reduce a buyer's budget and soften sales.

"In the short run, there may be a final burst of home sales and refinances as 'fence sitters' try to beat further rate increases," Sean Becketti, chief economist at Freddie Mac, told CNNMoney by email. "Next year, however, higher mortgage rates will drive down affordability, dampening demand and weakening home sales, softening house price growth, and slowing the growth in new home construction."

Yun pointed out that when rates made a similar move in 2013, home sales dropped 5% to 8% a month for a time.

Related: 4 money tips for new homeowners

"What could be a potential neutralizing factor is whether we will continue to see job creation or a faster rate of job creation," Yun said.

Tight inventory has propped up home prices, which has hurt affordability in many markets across the country.

Yun said he expects rates to continue to rise for the rest of the year.

"I would say the era of extremely super-low interest rates are over, now we are beginning to see steadily higher mortgage rates," he said.