Immigrants who are unlawfully in the United States and are closely related to U.S. citizens will soon be able to apply for permanent residency from inside the country, the Department of Homeland Security announced Wednesday.

The rule, set to go into effect March 4, will allow qualified people to apply for a provisional unlawful-presence waiver before leaving the United States to obtain their visas, significantly decreasing the time they must spend outside the country.

Currently, immigrants who are spouses, parents and children of U.S. citizens but who do not have legal status must leave the country, often for years, and apply for an immigrant visa abroad.

To qualify under the new rule, an applicant must be inadmissible only on account of his or her unlawful presence in the United States and must demonstrate that being separated from family would mean “extreme hardship” for his or her U.S. citizen close relative.

Applicants must still leave the United States for a brief period for the consular immigrant visa process; however, they will be able to apply for a provisional waiver before departing for an immigrant visa interview abroad.

The rule “facilitates the legal immigration process and reduces the amount of time that U.S. citizens are separated from their immediate relatives,” Homeland Security Secretary Janet Napolitano said in a statement.