When you’re thinking about buying your first home, it might seem like it’s all about the down payment. You save for years to have it, and you base a good portion of your home-buying budget on it. Next comes the mortgage. How much will you owe each month in principal, interest, taxes, and insurance? How does that compare with how much you currently pay as a renter?  If you’ve figured out how to tackle those two huge expenses, you might think you have it made in the shade. But the hard truth is that those are far from the only expenses you’ll incur when you buy a house.

In fact, there are lots of hidden costs to anticipate. These fees might affect your overall budget, timeline for buying, and what kind of home you want to buy. It’s important to consider them early in the process, before you fall in love with a place you can’t afford.

1. Home Inspection

After you’ve submitted an offer on a home and the seller has accepted, make sure the place you’re planning to buy isn’t a lemon. Hire a certified home inspector to examine the property from top to bottom before you go to closing. If you uncover hidden structural, mechanical or other issues, you can negotiate the repair terms with the seller before you finalize the deal. Otherwise, you will be solely responsible for any problems and the cost of fixing them.

2. Appraisal Fee

Your mortgage lender wants to be sure the home it’s about to loan you many thousands of dollars to buy is worth every penny. That is why you need a home appraisal before finalizing a mortgage loan agreement. The lender will hire an independent certified appraiser to assess the property value of the home for sale. This includes documenting the various features that make a home valuable, such as a deck, as well as researching the prices of comparable homes sold recently in neighboring areas.

3. Escrow Account

Some lenders require that an escrow account be set up in conjunction with a mortgage loan agreement. The money that goes into the account is used by the lender to pay certain ongoing property-related expenses on the homeowner’s behalf, such as homeowner’s insurance premiums, private mortgage insurance (PMI) premiums and property taxes. You might be required to make an initial deposit into the escrow account at the closing table. From then on, in addition to a mortgage payment, the homeowner will pay a little extra to the lender each month — typically one-twelfth of the estimated annual bill for taxes and insurance, according to Nolo.com. Essentially, escrow accounts help protect the lender by ensuring that these critical homeownership expenses are paid in full and on time.

4. Closing Costs

While having enough money saved up for a down payment is great, it’s not the only cash you’ll need to seal the deal on a home purchase. You also need an additional 2% to 5% of the home purchase price to cover so-called closing costs, which can include everything from a loan origination fee and attorney fees to prepaid homeowners association fees and taxes.

For example, the average sale price for a new home in May was $337,000, according to the U.S. Census Bureau. A 20% down payment on that sale price amounts to $67,400. On top of that $67,400 down payment, though, you would need between $6,740 and $16,850 to cover closing costs.

5. Home Maintenance and Repair

Certain costs can creep up on you once you have the keys to your new home in hand. Unlike renting, in which a landlord foots the bill for maintenance, as a homeowner you’re on the hook for any upkeep and repair costs.