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

In a historic thaw of a relationship chilled since the early days of the Cold War, the United States announced plans Wednesday to restore diplomatic and economic ties with the communist island of Cuba.

The changes came with the abrupt release of an American government contractor, Alan Gross, who had been imprisoned in Cuba for five years. He stood when his plane cleared Cuban airspace and stepped off in the United States to hugs on the tarmac.

At the same time, the United States released three Cubans jailed for 15 years on spying charges, and Cuba released a U.S. spy held there for two decades.

President Barack Obama declared that the United States was ending an “outdated approach” after five decades of isolation failed to accomplish the goal of a democratic and prosperous Cuba. The United States and Cuba severed diplomatic relations in 1961, two years after forces led by Fidel Castro overthrew the Cuban government.

“Neither the American nor the Cuban people are well-served by a rigid policy that’s rooted in events that took place before most of us were born,” Obama said from the White House. “It’s time for a new approach.”

Obama said that the United States would relax travel, banking and commerce restrictions, and he instructed Secretary of State John Kerry to start talks to re-establish diplomatic relations, including the eventual opening of an American embassy in Havana.

“Noboby represents American values better than the American people,” Obama said, “and I believe this contact will ultimately do more to empower the Cuban people.”

A ban on travel to Cuba by American tourists can only be lifted by Congress, but Obama promised to talk to lawmakers about ending the full economic embargo. In the meantime, other licensed travelers will be allowed to bring home Cuban cigars.

Obama also told Kerry to review the U.S. designation of Cuba as a state sponsor of terrorism, which has been in place since 1982.

While Obama was speaking in Washington, President Raul Castro went on Cuban television to welcome the restored relationship. But he said there were still profound disagreements, including on human rights, and he said the two countries must live with their differences “in a civilized manner.”

The American policy shift was the culmination of 18 months of talks between the United States and Cuba in Canada, and a pivotal meeting in the fall at the Vatican, senior administration officials said. Pope Francis, who personally sent letters to Castro and Obama lobbying for greater openness, offered his congratulations.

Cuba agreed to release Gross, 65, on humanitarian grounds, a senior Obama administration official said. Gross went on a hunger strike earlier this year, and his wife said this month that he was “literally wasting away” in confinement.

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

In a dramatic flight to freedom, he was escorted by his wife, Judy, three members of Congress and the Secret Service. Gross stepped off the plane late Wednesday morning at Andrews Air Force Base outside Washington.

He thanked Obama for helping secure his freedom, and he voiced support for the re-opening of diplomatic ties.

“To me, Cubanos, or at least most of them, are incredibly kind, generous and talented. It pains me to see them treated so unjustly as a consequence of two governments’ mutually belligerent policies.”

Alan Gross. Back on U.S. soil. pic.twitter.com/Ut5jvdQGg2 — Jeff Flake (@JeffFlake) December 17, 2014

From the plane, Gross called his sister and daughters and told them he was free. On the plane were bowls of popcorn, a snack he had missed during his captivity, and a corned beef sandwich with mustard on rye, plus latkes and applesauce.

“Today is the first day of Hanukkah,” Gross said, “and I guess so far it’s the best Hanukkah that I’ll be celebrating for a long time.”

Judy Gross said earlier this month that her husband had lost more than 100 pounds and gone mostly blind in one eye. She has been critical of the Obama administration’s handling of the ordeal. Gross has refused most visitors, although he did meet with two U.S. senators in November.

Gross was working as a contractor for the U.S. Agency for International Development, which works to promote democracy in Cuba, when he was detained in 2009. His family has said he was working to expand Internet access for Cuba’s small Jewish community.

Gross was sentenced in 2011 to 15 years in prison for undermining Cuba. Castro called him a spy.

Senior U.S. officials took pains to say that Gross was not being released as part of a direct swap. Separately, senior U.S. officials said that the three Cubans were being released in exchange for what U.S. officials described as an “intelligence asset.”

The spy’s name and other details remained classified, but Obama and intelligence officials described his work as instrumental, including in the arrest and conviction of the three Cubans who were released on Wednesday.

“In light of his sacrifice on behalf of the United States, securing his release from prison after 20 years — in a swap for three of the Cuban spies he helped put behind bars — is fitting closure to this Cold World chapter of U.S.-Cuban relations,” the office of James Clapper, the director of national intelligence, said in a statement.

Bureau of Prisons records showed that the three Cubans — Ramón Labanino, Antonio Guerrero and Gerardo Hernandez — were released on Wednesday.

A lawyer for the three, Richard Klugh, said he had not spoken to his clients before they boarded a plane to Cuba. He told NBC News that he was certain they were relieved to have “an arduous experience” behind them.

“After 16 years of imprisonment, two years of solitary confinement and so much time spent in dangerous prisons, this is not a slap on the wrist,” he said.

Labanino and Guerrero have received visits from family while they were jailed, but Hernandez has only seen his wife once in 17 years because she was deported after his arrest, Klugh said.

“There is no words to express how he must feel,” the lawyer said.

They were part of a group known as the Cuban Five. The two other members, Rene and Fernando Gonzalez, were released in 2012. The five were arrested in 1998 and accused of belonging to a spy cabal called the Wasp Network that had infiltrated anti-Castro exile groups in Florida.

As it announced the policy changes, the White House called on Cuba to relax the political, social and economic restrictions on its own 11 million people.

There have been signs in recent months of a warming between the two countries. Obama and Castro will attend a summit in Panama in April, the first to include both leaders, and Secretary of State John Kerry has praised Cuba’s efforts to fight Ebola.

Obama has eased travel restrictions in recent years, but he has left in place a decades-old economic embargo.

The announcement was certain to have repercussions throughout American politics and the emerging 2016 presidential campaign. Sen. Marco Rubio, R-Fla. and a potential candidate, said the policy change was “the latest in a long line of failed attempts by President Obama to appease rogue regimes at all cost.”

An unidentified plane sits at the end of a runway in Havana, Cuba on Dec. 17, 2014. Mary Murray / NBC News

— Tracy Connor, Jim Miklaszewski and Kristen Welker of NBC News contributed to this report.