Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The Obama administration is ending a policy, dubbed "wet foot, dry foot," which gave Cuban arrivals to the U.S. residency even if they didn't have visas, the White House announced Thursday.

"Effective immediately, Cuban nationals who attempt to enter the United States illegally and do not qualify for humanitarian relief will be subject to removal, consistent with U.S. law and enforcement priorities," Obama said in a statement.

"By taking this step, we are treating Cuban migrants the same way we treat migrants from other countries. The Cuban government has agreed to accept the return of Cuban nationals who have been ordered removed, just as it has been accepting the return of migrants interdicted at sea," he said.

Related: End to Cuba Migration Policy Draws Anger, Agreement, Surprise

The policy change has been in the works as the U.S. and Cuba work to cement changes in the relationship between the two countries. The changes include a path to return to Cuba for those unable to enter the U.S.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The changes also come roughly one week before Obama leaves office. The president made a historic visit to the island nation last year— the first American president to do so since Calvin Coolidge made the trek nearly 90 years ago.

The wet foot, dry-foot policy was added in a 1995 revision of the Cuban Adjustment Act, the 1966 legislation intended to isolate Cuba, which Obama has worked to eliminate. Cubans who were apprehended in the waters between the two countries, however, were returned to Cuba under the policy.

The policy was designed to prevent mass migrations of Cubans to the U.S., while still recognizing the political ramifications of turning back Cubans, particularly from the Cuban American community where the opposition to the Castro regime has been fervent.

Josefina Vidal, the Cuban foreign ministry’s director general of the department of the U.S., said Thursday’s announcement solves a major problem regarding the normalization of migration relations, but called on Congress to eliminate the Cuban Adjustment Act.

U.S. Homeland Security Secretary Jeh Johnson and White House Advisor Ben Rhodes also said Congress should repeal the law.

Advocates for ending the policy hailed the administration's move.

"This is a logical, responsible, and important step towards further normalizing relations with Cuba," James Williams, president of Engage Cuba, a non-profit group working to end the travel and trade embargo on Cuba said in a statement. "The 'wet foot, dry foot' policy has been an enduring problem that decades of hostility and isolation failed to solve. This change, which has long had strong bipartisan support, would not have been possible without the re-establishment of diplomatic relations with Cuba."

But Sen. Bob Menendez, D-N.J., who is Cuban American, issued a terse statement in response to the surprise announcement.

"Today's announcement will only tighten the noose the Castro regime continues to have around the neck of its own people," Menendez said.

Sen. Marco Rubio, a Republican and the son of two Cuban parents, in a statement Thursday acknowledged the need for reforms but said "the Obama Administration’s characterization of this change as part of the ongoing normalization with the Castro regime is absurd." Rubio called the Obama administration's Cuba policy a failure that was responsible for increased migration to the U.S.

In addition to ending the wet-foot, dry-foot policy, the Obama administration is doing away with a 2006 program that allowed medical personnel required by Cuba to study or work in a third country to essentially "defect" to the U.S. Obama said the program contradicts ongoing U.S.-Cuba efforts to combat diseases.

Rubio called the Cuban policy of forcing doctors to go abroad "political repression" and said he is hopeful that the Trump administration will reverse course and continue to allow medical personnel in other countries to seek assistance at U.S. embassies or consulates.