"Delighted to announce Brit Karl Andree will be released from Saudi custody within a week and reunited with his family," Hammond wrote on Twitter after meeting King Salman on a visit to Saudi Arabia.
Prime Minister David Cameron added on Twitter that the news was "good to hear".
The family of Andree, 74, said he had been told he faced 350 lashes in public after serving a year behind bars for being caught with home-made wine.
Cameron wrote to the Saudi government about Andree's case earlier this month and his spokeswoman had called the case "extremely concerning".
More From This Section
Andree's son Simon said he feared the grandfather of seven would not survive a flogging.
Andree worked in Saudi Arabia's oil industry for 25 years.
The move comes as Britain's traditionally close ties with Saudi Arabia come under increasing scrutiny over its human rights record.
Earlier this month, the British government abandoned a bid to provide training to the Saudi penal system, a contract potentially worth USD 9 million amid reports of a split between ministers.