As part of its status as Britain's six-day-a-week universal service provider, Royal Mail is exempt from paying value-added tax, currently set at 20 percent, on revenues it receives from delivering mail that is collected and sorted by rivals.

In a lengthy case against HM Revenue and Customs, Whistl argued that the exemption contravened EU law, but the UK High Court ruled on Thursday that it was compatible.

Whistl, a unit of Dutch mail group PostNL that was formerly known as TNT Post UK, collects and sorts mail in certain parts of Britain before handing it over to Royal Mail for delivery through an access contract.

Since April 2012, the firm has begun delivering mail itself in Manchester and London without using Royal Mail's network, and it has plans for a wider service.

Royal Mail has said Whistl's delivery service could undermine its own universal service, because Whistl targets only the most profitable delivery areas.

"Only because of much higher efficiency is Whistl still able to compete in the market at price levels comparable with those of Royal Mail," Whistl said in a statement, adding it would review the judgment and then consider its options for appeal.

The decision is a boost for Royal Mail, which had warned in its prospectus ahead of its London stock market listing that a negative ruling would have led to higher prices, with the inclusion of VAT, and lower revenue as customers could have turned more to email, social media or other services.

Shares in the firm, which have risen to as high as 618 pence since it listed last October, hit a low of 388p in September due to warnings of falling volumes in letters and parcels and to concerns about Whistl's fledgling rival business mail delivery offer.

Shares in Royal Mail were up 1 percent at 453.5p at 1412 BST, still 37 percent above its 330p offer price.

(Editing by Paul Sandle and Jane Baird)

By Neil Maidment