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.
Boris Johnson said he was “delighted” the pair could be reunited with their families after years in 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 will not be returning to the UK, Foreign Secretary Liz Truss said.
She said 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.