An "out of control" bonfire in east Belfast must be reduced to a maximum height of three metres, the High Court has ordered.
A judge directed the Department for Infrastructure to take immediate steps at Bloomfield Walkway.
It comes amid claims the controversial 80 pallet-high construction poses a serious threat to surrounding homes.
Mrs Justice Keegan's ruling came in emergency proceedings brought by Belfast City Council.
She said: "The balance is in favour of the more predictable risk to the public, of damage to life and property, if there's not something done about this bonfire which is now out of control."
The order will apply unless any last-minute, community-based resolution is reached and agreed on before it is due to be lit on Wednesday night.
East Belfast UVF 'hampering efforts'
Lawyers for the council took a case against the department over a failure to intervene and bring the bonfire being built on its land within limits recommended by Fire Service safety guidelines.
The court heard the bonfire is under the control of "sinister forces" within the east Belfast UVF hampering efforts to resolve the issue in the area.
Barrister Denise Kiley, for the council, claimed the structure, in its current state, towers over surrounding property and poses a significant risk to lives.
With up to 3,000 people expected to attend the Eleventh Night celebrations in the area, she argued that the bonfire was unpredictable and dangerous.
Up to 50 houses may have to be boarded up, while the Fire Service plans to take the unusual step of having an appliance pre-deployed at the scene, the court was told.
Department 'between rock and a hard place'
Philip McAteer, for the department, countered that any intervention by his client could lead to resistance and violence.
Based on available assessments, he said: "There's a possibility disorder could spread to other bonfire sites or to sectarian interfaces not only in Belfast but across Northern Ireland."
Mr McAteer added: "The department was stuck between a rock and a hard place, it did the best it could."
Delivering judgment, Mrs Justice Keegan expressed frustration that the issue of bonfires had ended up in court once again.
But she stressed that any potential unlawfulness should not be able to prevent steps taken to manage the identified risks.
"Damages are not an adequate remedy in circumstances where there's a risk to people's lives," she pointed out.
"In my view it was perfectly proper of the council to bring this matter to court."
A Department for Infrastructure spokesperson said: "The court order places a mandatory requirement on the department and we are taking steps to comply with it."