The key to saving your home could be in the palm of your hand.

Getting into a refinance can be challenging enough under the best of circumstances. But if you're one of the millions of homeowners with an underwater mortgage, refinancing might seem impossible. It's not.

When the housing crisis that peaked from 2007 to 2009 hit homeowners hardest, many were faced with owing more on their mortgages than their homes were worth. That's an underwater mortgage, and an automatic disqualifier for the traditional refinance route.

Fortunately, the federal government implemented two programs aimed at helping people with underwater mortgages. They've saved many homes from foreclosure, and one of them could help you secure a better interest rate, lower payments, or both as long as you qualify.

Here's what you need to know:

Home Affordable Refinance Program (HARP)

The Home Affordable Refinance Program (HARP) is available to homeowners who aren't in default, but need assistance with affordability, according to the Lending Tree.  Your mortgage must be no higher than 125 percent of the home's value, and you can't have any delinquent payments within the past 12 months.

Further, Bankrate says that your loan must be owned by Fannie Mae or Freddie Mac. If you're not sure, you can find out at the Making Home Affordable website. You can also apply at that link.

Although not everyone can qualify for HARP, it's worth trying if you're struggling to make your payments and can't refinance through the more traditional channels. Your credit score does factor into qualification, as does your payment history and other details that vary from lender to lender.

HAMP isn't a refinance, but it has the similar effect of better terms afterward.

Home Affordable Modification Program (HAMP)

If you're one of the millions in serious mortgage trouble with delinquencies and even possible foreclosure on the horizon, the Home Affordable Modification Program might save your home. HAMP isn't a mortgage refinance, but a restructuring of your existing loan to more favorable terms. It's a shift in the contract to make the loan easier for you to repay.

HAMP is limited to loans that are owned by Fannie Mae, Freddie Mac, and, according to Bankrate, certain others that 'signed up with the U.S. Treasury to qualify for HAMP.' You must also prove financial hardship, and show that your payment is more than 31 percent of your income.

Because this isn't a refinancing program, the stipulations are different. Lenders receive financial incentives for modifying loans, and the results can be a longer loan term and a better interest rate, at least for a while. After 6 years, HAMP modified loans can experience a 1 percent interest rate increase per year, which maxes out when it reaches the market rate that existed when the loan was modified.

An underwater mortgage can feel like the weight of the world, but there are federal programs designed to help. They can't fix every possible circumstance, but they do cover a lot.

The deadline for both programs is currently December 2016. Apply with Making Home Affordable or just get more information, and you could find better and more affordable terms that save your home.

If refinancing or restructuring are not an option for your loan, selling could save your credit and put you back on solid footing again. Check out eppraisal's services to help sell your home today.