A U.S. appeals court has ruled that a New York judge went too far in a recent decision favoring a second group of holdout investors in a longstanding debt dispute with Argentina.

The 2nd U.S. Circuit Court of Appeals said Monday that U.S. District Judge Thomas Griesa should not have ruled in June that Argentina needed to pay $5.4 billion to the so-called me-too debt holders before paying its majority creditors.

The court ordered Griesa to limit his scope to the group of hedge funds that initially sued Argentina after refusing to accept bond swaps.

The dispute has its roots in Argentina's $100 billion default in 2001. Griesa has repeatedly ruled that Argentina can't make payments on its debt without paying $1.3 billion to the holdout funds.