WASHINGTON (AP) — Turmoil in the stock market and the European debt crisis are making life easier for American homebuyers and families looking to refinance: Mortgage rates are inching closer to a record low.

The window of opportunity may close soon. Home loan rates will rise if investors grow more confident and shift money out of the safety of government bonds, which influence mortgage rates.

For now, though, rates are tantalizingly low. The average 30-year fixed-rate loan sank to 4.78 percent this week, the lowest this year and barely above the record of 4.71 percent set in December. And 15-year loans are at their lowest rates in two decades.

"Strike now," suggested Greg McBride, senior financial analyst at Bankrate.com.

Some homeowners are doing just that. Applications to refinance surged this week to the highest level in seven months, the Mortgage Bankers Association said.

Anxiety over the European crisis has caused global investors to snap up Treasury bonds, which they view as much safer than other investments. Treasury yields have fallen as a result, taking mortgage rates down, too.

When the crisis eases, and especially if the American economy recovery stays on track, expect investors to move out of bonds and back into stocks. That would make mortgages more expensive.

"If the economy finally really shows sustained improvement, rates are definitely going to go up," said Fred Chamberlin, a consultant with Alpine Mortgage Planning in Eugene, Ore.

He suggests that homeowners looking to refinance move fast and not hold out for even lower rates. "If you want the bottom, the only way you're going to know it is when you've missed it," Chamberlin said.

Refinancing isn't right for everyone who qualifies. It typically costs several thousand dollars in fees. Experts suggest calculating how long it will take to recover those fees with the lower loan rate.

As cheap as mortgages are these days, the number of loans being taken out to buy homes remains at its lowest point in more than 13 years. One reason is that a special tax credit for homebuyers expired last month. Many people had rushed to sign contracts by then.

Another obstacle: trouble qualifying for a mortgage. Borrowers need solid credit and a down payment of at least 3.5 percent. Banks tightened lending standards after millions of borrowers fell into default and foreclosure during the housing bust.

"They're really looking with a magnifying glass," said Steve Mevorah, a loan officer with Icon Mortgage Inc. in Las Vegas. "They're trying to make sure that they are flawless loans."

Analysts had expected mortgage rates to rise when the government ended a program designed to bolster the housing market. Instead, they fell because of fears that Greece would default on its debt.

Also keeping rates low is the government's decision last year to provide unlimited support through 2012 for Freddie Mac and Fannie Mae, which buy mortgages and package them into securities and help keep rates low.

Investors "are very comfortable with the guarantee that is in place," notes Credit Suisse mortgage strategist Mahesh Swaminathan. "That, for all practical purposes, is very strong government support."

Since the financial crisis ended, mortgages of all types have become more affordable — from the 30-year fixed to adjustable varieties.

The premium that borrowers pay to take out "jumbo" loans for more expensive homes has dropped by a full percentage point since late 2008, to just 0.8 percent, for instance.