MasterCard Worldwide agreed on Wednesday to pay $1.8 billion to its credit card rival American Express to settle claims related to a 2004 antitrust lawsuit.

Seven months ago, Visa paid more than $2.1 billion to American Express to put similar claims behind it as it raced ahead with plans for an initial public offering in March. MasterCard, which went public two years ago, had been under pressure to resolve the suit because uncertainty surrounding the litigation was one of the few clouds hanging over its rapidly rising stock.

The agreement brings the total that American Express has collected to more than $4 billion, one of the richest settlements in corporate history. With losses rising and the economy in a slump, American Express can use the cash.

“Business conditions continue to weaken in the U.S., and so far this month we have seen credit indicators deteriorate beyond our expectations,” the chairman and chief executive of American Express, Kenneth I. Chenault, said. He said the settlement would provide a multiyear source of funds that would “lessen the impact of this weakening economic cycle and, when conditions improve, give us the ability to step up investments in the business.”