Royal Mail has failed to have a record £50m fine from Ofcom overturned.
The fine, announced in August 2018, related to its actions in 2014 when Whistl, then known as TNT, was trying to become its first competitor in wholesale mail delivery.
Ofcom's investigation followed a complaint by Whistl that Royal Mail had abused its dominant market position.
Royal Mail challenged the fine, but on Tuesday, the Competition Appeal Tribunal dismissed its application.
An Ofcom spokesperson said: "We found that Royal Mail pursued a deliberate strategy of pricing discrimination against Whistl, which was its only major competitor for delivering business mail.
"Royal Mail had a special responsibility to ensure its behaviour was not anti-competitive.
"We hope that our fine, which has been upheld in full by the Tribunal, will ensure that Royal Mail and other powerful companies take their legal duties very seriously."
Ofcom's investigation had found that Royal Mail price rises in 2014 meant any wholesale customers, such as Whistl, which wanted to compete with it would have to pay higher prices in the remaining areas where it used Royal Mail for delivery.
Whistl said it was pleased that the Ofcom ruling had been upheld.
"Royal Mail's actions had a hugely negative impact on investment in, and the competitive health of, the UK postal sector," Whistl said.
Whistl said it was now looking at its options to decide whether to seek damages.
Royal Mail said it was disappointed by the tribunal's decision.
"We are considering all legal options, including whether to seek permission to appeal and to request that payment of the penalty, which would otherwise become payable, be stayed pending any appeal.
"We will provide an update once we have completed our legal review," it said.
It had argued that it raised prices to protect the Universal Service, which means post is charged at the same rate, regardless of where it is sent across the UK.
Unlike its competitors, it is required to continue providing such pricing.
The CAT decision was announced as Royal Mail was asking the High Court to stop a postal strike, claiming that the ballot of workers had "potential irregularities".
A strike threatens to disrupt postal voting in the run-up to the general election, as well as Christmas post.
Royal Mail says the the strike ballot "was unlawful and, therefore, null and void", but the Communications Workers Union "refutes" Royal Mail's claim.