British-Iranian nationals Nazanin Zaghari-Ratcliffe and Anoosheh Ashoori are on a plane leaving Iran after being freed, the government has said.
Mrs Zaghari-Ratcliffe will be reunited with her husband and seven-year-old daughter, who plans to show her mother new toys when she returns to the UK.
"It's going to be the beginning of a new life," Richard Ratcliffe said.
Mr Ashoori's family said they could now rebuild the foundations of their family with their "cornerstone back in place".
In a statement, they hailed his release and return to the UK after "five long years" before thanking those who worked to bring him home.
Prime Minister Boris Johnson said he was "delighted" the pair could be reunited with their families after years of detention.
The government said it had also settled a debt owed to Iran from the 1970s.
Mrs Zaghari-Ratcliffe had been held in Iran since 2016 - accused of plotting to overthrow Iran's government, which she denied.
Mr Ashoori was arrested in 2017 and accused of spying, a claim he denied.
A third dual national, Morad Tahbaz, has been released from prison but is not yet allowed to leave Iran, Foreign Secretary Liz Truss said.
She added that ministers would keep working to secure his release.
Cuddling his daughter, Gabriella, Mr Ratcliffe told journalists they would really believe the news when they saw "mummy".
He said he wanted to thank people "up and down the country" for supporting his campaign for her release, which included him going on hunger strike last October.
"Ours has been a cruel experience in some ways, but it's also been an exposure to such a level of kindness and care," he said.
"This will be a chapter in our lives, but there are many more chapters to come."
Mrs Zaghari-Ratcliffe had been under house arrest and was given her UK passport back this week.
Tulip Siddiq, Labour MP for Hampstead and Kilburn, tweeted a picture of Mrs Zaghari-Ratcliffe and wrote: "Nazanin is now in the air flying away from six years of hell in Iran."
"My heart goes out to Gabriella and Richard, as her long journey back home to them gets closer by the minute," she added.
Antonio Zappulla, chief executive of the Thomson Reuters Foundation where Mrs Zaghari-Ratcliffe worked as a project manager, said staff were "overjoyed" at news of her release.
He said she had endured "utterly inhumane treatment" over the past six years, including being "denied her freedoms, separated from her husband and young child, battling significant illness, thrown in solitary confinement".
But he added that her freedom was "a ray of light and hope" at a time when the world was "in turmoil and the news has been consistently bleak".
Mrs Zaghari-Ratcliffe's sister-in-law Rebecca Ratcliffe told BBC News it was an "emotional day".
She said Mrs Zaghari-Ratcliffe had been picked up and taken to the airport with her parents, who were not allowed in a holding room with her because she was "still under Iranian control in the airport".
A £400m debt relating to a cancelled order for 1,500 Chieftain tanks dating back to the 1970s had been linked to the continued detention of Mrs Zaghari-Ratcliffe and other UK-Iranian dual nationals held in the country - although the government had previously said the two issues should not be connected.
Ms Truss told the BBC on Wednesday the debt was "legitimate" and that the government was looking for ways to pay it.
Labour leader Sir Keir Starmer said it was "an incredible moment" for Mrs Zaghari-Ratcliffe and her family after an "unimaginable ordeal".
He added that there would be questions to be answered about "what happened along the way", but at present his thoughts were with the family.