The ideal situation is to enter your retirement years without any monthly mortgage payments. But what if you've finally found your dream home at the same time that you're leaving the working world? What if you're ready to buy a home in a new city in which you've always wanted to live, but you're approaching your 70th birthday?

The good news is that the federal Equal Credit Opportunity Act law prohibits lenders from denying potential borrowers because of their age. The bad news is that you'll have a mortgage payment and the burden of caring for a house in your retirement years.

"It can be bad to have a mortgage payment in your 80s," says Keith Baker, professor of mortgage banking at North Lake College in Irving, Texas.

All sorts of things can happen to you, unfortunately. What if you develop Alzheimer's? What if your children aren't financially sophisticated and can't take over handling your mortgage for you? There are all kinds of reasons not to have a mortgage when you're that age. But if you can afford a mortgage payment when you're in your 60s and early 70s and you're in good health, why not buy that home that you've always wanted?

If you want to buy a home after you've retired, you'll need to first consider several factors, and you'll need to overcome a variety of hurdles both to qualify for a mortgage loan and to find a home that fits your changing needs as you age.

Do you want a monthly payment in retirement?
Lenders need proof that you can afford your monthly mortgage payment now that you are retired. It might be difficult to provide this proof if you no longer have a steady salary. But lenders will consider other forms of income, including monthly Social Security payments, rental income from investment properties, regular payments from legal settlements, payments from retirement accounts and pensions, and any other income you receive every month.

"Can you really afford that mortgage payment? That's the question you need to ask no matter what age you are," says Kyle Winkfield, founder, president and CEO of The Winkfield Group, a financial planning firm in Rockville, Maryland.

Your mortgage payment should not be a financial burden in your retirement years. You might want to travel, but your mortgage payment might mean that you can't afford that cruise or airplane flight.

How long do you want to be making mortgage payments? 
Many borrowers apply for 30-year loans because they generally come with the lowest monthly payments. But such a long-term loan might not make sense for borrowers who are already in their retirement years, says David Reiss, professor of law and research director for the Center for Urban Business Entrepreneurship at Brooklyn Law School in New York City.

"If you are 62, you will not have paid [the loan] off until you are 92," says Reiss. "Retirees should look at their expected incomes over those 30 years to ensure that they have sufficient income to cover the mortgage over the whole period."

Income can fluctuate during the retirement years. Maybe payments from a legal settlement run out. You might struggle to find renters for your investment properties. Royalties can dwindle. At the same time, expenses -- especially medical ones -- might rise.

Reiss says that it makes sense for retirees to take out a loan with a shorter term, such as a 15-year fixed-rate loan, if they can afford the higher monthly payments that come with such loans.

What about evolving housing needs? 
Retirees need to also consider how their housing needs might change over time, says Karen Sparks, a financial analyst and founder and owner of Divorce Financial Strategists in Santa Clara, California. Just because a home works for you when you're 67 doesn't mean it will be a good fit when you're 77, says Sparks.

You might not need a ranch home when you're 60, but you might appreciate the lack of stairs when you're in your 70s. You might not care that the master bedroom is on the second floor until you hit your 80s and climbing up and down those stairs each day becomes a chore.

When buying a home, then, think of your future self. If you plan to age in place in your new home, what won't you want to be doing in your late 70s or early 80s?

What about other costs?
What about the other costs of owning a home, besides the monthly payment?

Baker says that too many clients forget about property taxes, homeowners insurance and maintenance costs when buying a home. This can be particularly troublesome for retirees who are living on a fixed income.

"I had a client who wanted to change the locks in her house," Baker says. "You have someone do that 10 years ago, it might have cost $85. Now it cost her $250. Little things like the care and maintenance of a house can add up."

Buying a home in your retirement years is certainly feasible, but you must consider all the costs and care over time.

This article originally appeared on HSH.com.

You may also enjoy these financial articles:

By Dan Rafter for HSH.com. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.