Foreign Secretary Boris Johnson has lifted a ban on UK embassies and high commissions flying the rainbow flag during gay pride events.
In one of his first policy shifts since coming to office, Mr Johnson overturned the decision of predecessor Philip Hammond, who insisted that only the Union flag, the EU's blue-and-gold flag and the flags of the nations and overseas territories of the United Kingdom could be flown from Foreign Office buildings.
The decision on whether and when to raise the gay pride banner will be for individual ambassadors and high commissioners to take, taking into account of local conditions.
The turnaround was revealed by PinkNews, which quoted a Foreign Office spokesman saying that the rainbow flag could be flown to mark events such as the International Day Against Homophobia, Biphobia and Transphobia (IDAHOBIT) on May 17 as well as local pride celebrations.
A Foreign Office spokesman told the Press Association: "The Foreign Secretary has decided that the rainbow flag can be flown from Foreign and Commonwealth Office buildings in the UK and embassies and high commissions overseas.
"Whether it is flown is a matter for individual ambassadors and high commissioners, depending on local circumstances."
While still Foreign Secretary, Mr Hammond last month rejected a call from the House of Commons Foreign Affairs Committee to drop his opposition to use of the rainbow flag.
In a report on the FCO's human rights work, the committee said Mr Hammond's decision not to fly the flag for Pride 2015 in London "signalled an apparent change in FCO policy and sent a message that contradicts much of the actual work and objectives of the FCO".
The cross-party report recommended that the policy should be reversed and said that missions should fly the rainbow flag on May 17 in countries where official intolerance prevents the staging of gay pride events.
In an official response published on July 11, the Foreign Office said: "The FCO has a very clear policy on flag flying: it is to fly the Union flag at the FCO and all its embassies, high commissions and consulates at all times.
"The only other flags that are flown are of the constituent countries of the UK and the UK overseas territories on significant days for them, and the European Union flag in certain countries. These flags are always flown in addition to the Union flag and in a junior position. The UK is a member of, or supports, many organisations and associations, but does not fly any other flags."