On Liz Truss’s first day in the Foreign Office six months ago, she made it clear that her top priority was securing the release of three British nationals imprisoned in Iran.
Dual nationals Nazanin Zeghari-Radcliffe, Anoosheh Ashoori and Morad Tahbaz had been in jail in the country for six, five and four years respectively, and Foreign Office efforts to free them had been unsuccessful.
The closest that officials had come to an agreement with the Iranians was last summer, when Dominic Raab was foreign secretary. But, like all previous attempts, it had ultimately been unsuccessful.
Truss told her civil servants to be creative and come up with new ways to end the impasse.
After months of intense negotiations, the breakthrough finally came in talks in Muscat in February.
Details of the deal are confidential, but what we do know is that the UK agreed to pay a £393.8m debt it has owed Iran since 1979 for the purchase of 1,500 Chieftain tanks. In return, Tehran agreed that the three British-Iranian nationals could go free.
Zaghari-Ratcliffe and Ashoori are due to arrive back in Britain late this evening, while Tahbaz will be freed under furlough in the coming days.
Inside the Foreign Office, they are paying tribute to the legwork Truss has put in to secure the trio’s release.
Successive foreign secretaries have attempted to get to this point, but she is the only one to succeed.
Indeed one of them, a certain Boris Johnson, managed to make things worse for Zaghari-Ratcliffe by wrong telling a Commons committee that she had been in Iran training journalists.
This played into the hands of her captors, who had accused her of being a spy, and put back attempts to have her freed by years.
It led to Johnson having to make a humiliating apology in the Commons.
He said: “I hope the House will understand with crystal clarity that Mrs Zaghari-Ratcliffe was there on holiday. She was not there in any professional capacity.
“Insofar that people got a different impression, it was my mistake, I should have been clearer ... I apologise for the distress and anguish caused to Ms Zaghari-Ratcliffe and her family. Our priority now is to everything we can to get her out of Iran on humanitarian grounds.”
It would be nearly five years - and three more foreign secretaries - before the mother-of-one was finally released.
One of those to hold the office, Jeremy Hunt, paid tribute to Truss when he said: “Can I salute the leadership of the foreign secretary on this issue. As I know from my own experience, this is a fiercely difficult diplomatic challenge and it wouldn’t have been solved without sustained personal interest from the top and she deserves great credit for that.”
After a fairly torrid few weeks, marked by her much-derided backing for British citizens going to Ukraine to fight in the war, Truss’s stock is once again high among Conservative MPs, as well as her officials.
With a Tory leadership contest in the next few months still a possibility, and Truss making no attempt to hide her desire for the top job, the release of Zaghari-Ratcliffe, Ashoori and Tahbaz could not have come at a better time for her.