A federal appeals court has ruled that American Express (NYSE:AXP) can block merchants that accept its cards from steering customers toward lower-cost cards from other issuers. The provisions in American Express’ merchant agreements are meant to dissuade customers from using cards from Visa and MasterCard at retailers that take American Express cards. American Express had 47 million cards in the United States as of June 30, down about 15 percent from 55.3 million a year earlier. Visa and MasterCard together have about 1.2 billion.

Business owners that accept American Express cards have complained for years that the fees they pay are higher than those imposed by other credit card companies. The fees that merchants pay to process transactions is estimated at more than $50 billion a year, according to the U.S. government. Those fees can be passed along to cardholders in the form of higher prices. American Express argued that the higher fees it charges allows it to deliver more expensive benefits to its cardholders, setting it apart from competitors.

The ruling overturns a decision by a lower court judge in Brooklyn made in February 2015 that found that American Express’s actions violated federal antitrust law. Lower court judge Nicholas Garaufis, had found that non-discrimination provisions in American Express’ merchant agreements unreasonably restrained competition. The judge also imposed an injunction that also allowed merchants to offer discounts, rebates and other incentives to customers for using other cards with lower fees.

Garaufis said in his ruling that the non-discrimination provisions enabled American Express to wrongfully exploit its share of purchase volume in the U.S., which stood at about 26.4 percent in 2013. Visa accounted for about 45 percent of U.S. credit card transactions that year while MasterCard had 23.3 percent. Discover Financial Services had 5.3 percent.

The 2nd U.S. Circuit Court of Appeals in New York said the previous court erred in its decision. Specifically, the appeals court said Garaufis erred by focusing entirely on the interests of merchants rather than cardholders who might benefit from American Express rewards programs and prestige. Circuit Judge Richard Wesley wrote for a three-judge panel, “So long as AmEx’s market share is derived from cardholder satisfaction, there is no reason to intervene and disturb the present functioning of the payment-card industry.”

The decision may help American Express boost revenue after the loss of lucrative co-branding relationships, such as with Costco Wholesale. Chief Executive Kenneth Chenault told employees in a memo, “American Express earned a major victory today.” Chenault’s memo continued, “We have to realize that this fight may not be over. The Justice Department may decide to appeal this decision.” Chenault said the firm will continue to fight the case if the Justice Department appeals.