The Department of Housing and Urban Development announced the launch Monday of a $1 billion program to save delinquent homeowners in more than two dozen states from foreclosure.

Unemployed homeowners or those underemployed because of economic conditions or a medical condition will be eligible for an interest free loan that will cover a portion of their mortgage for up to two years, or up to $50,000, whichever comes first. The program, known as the Emergency Homeowners’ Loan Program, is expected to help up to 30,000 distressed borrowers, according to HUD.

Maryland and Virginia were among the states choosen by HUD to share in the funds, which are being distributed to nonprofit and government housing agencies. Homeowners have until July 22nd to apply for the help.