LONDON — Three and a half years after she and her mother were abruptly detained in a Tehran airport, beginning a saga that pitted Britain against Iran in a diplomatic dispute, Gabriella Zaghari-Ratcliffe, 5, was reunited with her father in Britain on Thursday night.

Her mother, Nazanin Zaghari-Ratcliffe, a British-Iranian citizen, remains in a Tehran prison. Ms. Zaghari-Ratcliffe has been held since 2016, after she and Gabriella were stopped at the airport while attempting to return to their home in London after visiting family in Iran.

Ms. Zaghari-Ratcliffe’s husband, Richard Ratcliffe, a British citizen, described seeing his daughter in person for the first time since she was a toddler.

“Gabriella came back to us late at night, a bit uncertain seeing those she only remembered from the phone,” Mr. Ratcliffe said in a statement. He had been in regular contact with his daughter by phone and video calls throughout her time in Iran, where she has lived with her mother’s family.