Her husband Richard Ratcliffe, who has fought a tenacious battle to secure her release, said he was “deeply grateful” and that he and their daughter Gabriella were “looking forward to a new life”.
The British-Iranian mother is returning to Britain, along with a second dual national, Anoosheh Ashoori.
A third dual national, Morad Tahbaz, has been released from prison on furlough.
Mrs Zaghari-Ratcliffe was detained on security charges by the Iranian Revolutionary Guard at Imam Khomeini airport after a holiday visit to Iran where she introduced her daughter Gabriella to her parents.
Mr Ashoori has been in prison for almost five years while Mr Tahbaz has been held for four.
Their release follows months of intensive diplomatic negotiations between London and Tehran.
Foreign Secretary Liz Truss said: “We have the deepest admiration for the resolve, courage and determination Nazanin, Anoosheh and Morad, and their families, have shown.
“They have faced hardship that no family should ever experience and this is a moment of great relief.”
Mr Ratcliffe has long claimed that his wife was being used as a pawn in a dispute between the UK and Iran over the unpaid debt linked to an arms deal
The UK has paid the £393.8 million owed to Iran after it cancelled an order of Chieftain tanks following the overthrow of the Shah in the revolution of 1979.
In a statement, Ms Truss confirmed the debt had been settled “in parallel” with the release of the detainees.
She said it had been done “in full compliance with UK and international sanctions and all legal obligations”.
She added: “These funds will be ring-fenced solely for the purchase of humanitarian goods.”
Sanctions on the Tehran regime had been one of the key sticking points in being able to settle the debt.
Ms Zaghari-Ratcliffe and Mr Ashoori were initially being take to the Gulf state of Oman – which has been closely involved in the behind-the-scenes negotiations to secure their release.
Oman’s foreign minister Badr Albusaidi posted a picture of them arriving at the airport, adding: “Soon they will be with their loved ones at home.”
From there it is expected they will be flown on a Government-chartered flight to RAF Brize Norton in Oxfordshire.
Boris Johnson, visiting Gulf states, welcomed news of the detainees’ release.
“The UK has worked intensively to secure their release and I am delighted they will be reunited with their families and loved ones,” he tweeted.
Mrs Zaghari-Ratcliffe’s MP Tulip Siddiq, who has long campaigned for her release, posted a photograph of her on the flight carrying her to freedom.
“It’s been six long years – and I can’t believe I can FINALLY share this photo. Nazanin is now in the air flying away from six years of hell in Iran,” she tweeted.
Mr Ratcliffe, campaigned tirelessly for her release including staging a hunger strike outside the Foreign Office.
He said: “We can stop being a moment in history and start being a normal family again.”
He said his wife had a “big grin” in the photo on the plane and “it is going to be lovely to see her, lovely to catch up with her”.
Mr Ratcliffe said he had been “kept out of the loop” on discussions about settling the arms debt, but “I’m relieved the problem has been solved”.
He said his wife had asked him to make her a cup of tea when she arrives in the UK.
Speaking alongside Gabriella, he added: “I think actually we were looking at the house and it needs a bit of tidying, so there might be a bit of tidying, perhaps directed by mummy when she comes back.”
In a statement the family of Mr Ashoori said: “This day has been a long time coming, and we are thankful for the efforts of everyone involved in bringing Anoosheh home.
“1,672 days ago our family’s foundations were rocked when our father and husband was unjustly detained and taken away from us. Now, we can look forward to rebuilding those same foundations with our cornerstone back in place.”