NEW YORK (CNNMoney.com) -- The fight for who would win Wachovia - Citigroup or Wells Fargo - heated up Sunday night.

New York State Supreme Court Justice Charles Ramos had issued an order late Saturday that temporarily blocked the merger of Wachovia with Wells Fargo.

Wachovia responded Sunday with lawsuits of its own. In a Sunday night ruling, the Appellate Division of State Supreme Court threw out the order by Ramos, the Associated Press reported. Citigroup said it would appeal the decision.

In a deal struck last Monday with the assistance of the Federal Deposit Insurance Corporation (FDIC), Citigroup had offered to take over Wachovia's banking operations for $2.2 billion. The deal did not include Wachovia's asset-management or retail-brokerage units.

Four days later, Wells Fargo said it was buying all of Wachovia for approximately $15.1 billion in stock.

"This deal enables us to keep Wachovia intact and preserve the value of an integrated company," Wachovia CEO Robert Steel said in a statement on Friday.

The battle also has implications for taxpayers.

The Citigroup offer had come with a backstop from the FDIC, which would cover any losses on Wachovia's $300 billion loan portfolio beyond the first $42 billion. The Wells offer does not ask for FDIC assistance.

In a statement on Sunday, Wachovia said the company believes its agreement with Wells Fargo is "proper, valid and ... in the best interest of shareholders, employees as well as the American taxpayers." Citigroup is free to make a better offer to Wachovia under that agreement, the statement said.

The fight was also waged in federal court, where Wachovia asked U.S. District Judge John Koeltl to declare invalid part of the Citigroup deal that would have restricted Wachovia from considering competing bids. Koeltl scheduled another hearing for Tuesday so Citigroup could respond.

It was clear from documents filed in federal court Sunday that Wachovia was in considerable trouble when it agreed to the deal, the AP reported. Wachovia disclosed that it agreed to the deal "with the understanding that a seizure of its banking assets later that day by the Federal Deposit Insurance Corp. would occur" unless it accepted Citigroup's proposal.

As of Friday, Citigroup still had support of industry regulators. "The FDIC stands behind its previously announced agreement with Citigroup," Federal Deposit Insurance Corporation Chairman Sheila Bair said in a statement, adding that it would pursue a resolution with all three companies. An FDIC spokesman did not immediately return calls for comment on Sunday, the AP said.

Citigroup (C, Fortune 500) had been pressing Wachovia (WB, Fortune 500) and Wells Fargo (WFC, Fortune 500) to abandon their merger plans, arguing that it had entered into an exclusivity agreement with Wachovia.

A copy of the exclusivity agreement between Citigroup and Wachovia obtained by CNNMoney.com reveals that Wachovia had agreed not to seek out another bidder, nor to provide information or enter talks that might facilitate a rival bid.

Wells Fargo, in a statement Sunday, said it has "a firm, binding merger agreement," the AP reported.

Why they want Wachovia

A Wells Fargo victory would transform the San Francisco-based bank, whose operations and branches are largely located in the Midwest and on the West Coast, into a dominant presence along the East Coast and in the Southeast. Wachovia is based in Charlotte, N.C.

That would put Wells Fargo squarely in competition with the likes of JPMorgan Chase (JPM, Fortune 500) and Bank of America (BAC, Fortune 500).

Should Wells Fargo ultimately prevail, it will control about $800 billion in deposits and have nearly 11,000 banking locations.

"This would represent a major strategic win for Wells Fargo," said David Hendler, analyst with CreditSights, in a report.

If Citigroup wins, it would represent a huge step forward for the company's retail banking aspirations, whose footprint has lagged many of its biggest rivals.

Investors cheered Citigroup's decision last week to buy Wachovia's banking assets. But some observers had wondered whether Citigroup could pull off the deal since it is in the process of a major restructuring after posting close to $18 billion in losses over the past three quarters.

The tie-up, however, comes at a cost for Wells Fargo. The company said it expected to incur about $10 billion in merger related costs. It said it would also record Wachovia's impaired assets at fair value, which could bring further writedowns.

Howard Atkins, Wells Fargo's chief financial officer, said that pre-tax losses and market adjustments from Wachovia's loan portfolio would hit $74 billion and the bulk of that would be written off shortly after the transaction closes.

In the wake of Friday's news, rating agencies Standard & Poor's and Moody's both placed Wells Fargo on watch for a potential ratings downgrade.

Still, the company said it expected the acquisition to add to earnings in the first year of operations, adding that it planned to raise $20 billion, primarily through a common stock sale to help prop up its capital position.

In the last month alone, the nation's banking industry has undergone a dramatic facelift, including the failure of Washington Mutual and its subsequent purchase by JPMorgan Chase, as well as Bank of America's acquisition of Merrill Lynch (MER, Fortune 500).