The flying of the Union flag at courthouses and government buildings in Northern Ireland is not discriminatory, senior judges ruled on Tuesday.
They rejected claims by a nationalist woman that erecting the standard on designated days unlawfully denies her equal treatment.
Helen McMahon went to the Court of Appeal in a bid to establish that the practice breaches the Belfast Agreement.
But Mr Justice Horner said: “In our view the display of the Union flag on 15 days of the year over a courthouse which administers the laws of the UK cannot be regarded as excessive or provocative.
“Rather it should be regarded as a pragmatic reflection of the current reality of the constitutional position and actively consented to in accordance with the spirit of the Agreement that Irish people, north and south, signed up to.”
Ms McMahon centred her case on the Union flag being flown at her local courthouse in Omagh, Co Tyrone.
But her challenge widened out to include all other court and government buildings where it is erected at full mast on set days throughout the year.
In proceedings issued against the secretary of state, she stated that she recognises and acknowledges the Irish tricolour as her national flag
Under the current arrangements, according to her case, the flying of flags in Northern Ireland does not reflect her status as a member of the nationalist community.
Ms McMahon’s legal team contended that the practice, contained in the Flags Regulations (Northern Ireland) 2000, goes against the need to ensure parity of esteem for both traditions under the terms of the Belfast Agreement.
She mounted an appeal after a High Court judge dismissed her bid to secure a judicial review last year.
However, Mr Justice Horner, sitting with Lord Justices Stephens and Treacy, held that the secretary of state had taken the Agreement into account in making the 2000 Regulations.
“Tolerance of the presence of the Union flag is a practical demonstration of the principle of consent which the majority of people on both sides of the border have agreed to adopt,” he pointed out.
Refusing Ms McMahon’s appeal, the judge concluded: “The flying of flags on a small number of selected days over Omagh Courthouse does not disrespect the applicant or any part of her community, or provide additional respect to the Unionist community or its members.
“It prefers neither one community over another, nor does it hold one individual in higher esteem than another.
“It is not discriminatory. It simply reflects the constitutional position of Northern Ireland as part of the United Kingdom.”