Argentina has defaulted for the second time in 13 years after officials failed to come to an agreement with the country's bondholders.

After frantic last minute talks failed to produce a deal late Wednesday, Standard & Poor's deemed the country to be in default on some of its obligations. The change in credit rating could hike Argentina's borrowing costs, and put even more pressure on the country's already-struggling economy.

The crisis stems from a legal battle with a small group of "holdout" creditors that had demanded payment of about $1.5 billion on bonds they bought after the $144 billion default in 2001. That standoff has blocked payments to other creditors.

Economy minister Axel Kicillof met the "holdouts" for the first time in New York this week but said Wednesday that they rejected an offer he made.

Now, the country may have to devalue the peso to preserve foreign currency reserves, and that could trigger a dangerous rise in inflation that is already projected to hit 40%.

The peso has already fallen by about 25% against the dollar this year.

Neil Shearing, chief emerging markets economist at Capital Economics, said the default could have painful consequences for Argentina, but was unlikely to have a major impact beyond its borders.

"Markets are rightly viewing this as circumstances specific to Argentina, and it doesn't look like we've seen so-called contagion to other financial markets at this stage," said Shearing.

Last minute efforts fall short

There was still hope for a deal as discussions continued for a second day.

But Daniel Pollack, the court-appointed mediator, said late Wednesday that the talks had fallen apart. He said that "default cannot be allowed to lapse into a permanent condition" and that he would still be available to help the parties reach some kind of resolution.

It looked like Argentina's banks might throw the government a lifeline. The Wall Street Journal reported that they could agree to pay off the "holdout" creditors -- NML Capital and Aurelius Management -- and wait until next year to be repaid with government bonds. But that initiative too appears to have come to nothing.

How did it come to this?

The crisis has its roots in Argentina's last default. It reached agreement with almost 93% of creditors to restructure its debt, but 7% refused to accept.

The countdown to a new default started in earnest last month when a U.S. judge ruled that if Argentina doesn't pay the holdouts, it can't make any more payments to restructured bondholders.

Argentina worried that a deal with the holdouts could trigger billions of dollars in additional claims -- money it doesn't have.

"What the vulture funds want ... is that they be paid more than the 92.4%," said Kicillof. "This I have talked about many times and I have repeated it today before the funds suing us: it can't be done... can't be done."

Serial offender

This is Argentina's third default in 25 years, according to ratings agency Moody's. Still, it no longer holds the record for the biggest -- that now belongs to Greece after its distressed debt exchange worth $273 billion at the height of the eurozone crisis in 2012. Russia's $39 billion default in 1998 is the third largest in history.