The home-buying and -selling process can sometimes be a precarious thing as most sellers need to sell their house before having the money to buy a new space. But what happens if you stumble upon your dream house before coming to contract for a sale?

If you find yourself in this situation, you’ll want to explore gap financing options, which will allow you get the money for a new home, without having to rush into a sale of your own.

Home equity loans are one way to do this, but even more common today is what’s known as a bridge loan, or a temporary loan that “bridges” the gap between the sales price of a new home and a buyer’s new mortgage.

A bridge loan is secured to the buyer’s existing home with the money made available to be used as a down payment on the new home.

The way it works is interest on a bridge loan is paid up front for six months, relieving the buyer from having to make two house payments until their home sells. When the old home sells, the loan’s principal balance—and any accrued interest from sale proceeds—is then paid off.

Interest rates will vary depending upon the credit rating of the borrower, however, bridge loan interest rates tend to be higher than other loans, and such rates typically increase periodically over the initial term of the loan. Typically, a bridge loan is good for six months, but they can extend up to 12 months.

Many lenders also add a due-and-payable-upon-sale clause, which states that the loan must be paid when your old home is legally sold, regardless of any previous term stipulations.

For borrowers who can make both payments comfortably, the additional cost of paying for a refinance to create the bridge loan often outweighs the payment on a second mortgage for a few months.

Of course, there’s always the risk that your home doesn’t sell and you’ll be stuck paying two mortgages once the bridge loan expires. But if you’re confident in your home’s selling prospects, it’ll keep you from accepting any bid that comes your way, affording you the luxury of waiting for the best deal.