By Hilary Russ

(Reuters) - New Jersey's struggling gambling hub, Atlantic City was able to access capital markets for the second time in two weeks, albeit at high interest rates and only with state backing.

Atlantic City sold $12 million of tax-exempt general obligation bonds to Bank of America Merrill Lynch in a competitive offering, with a top yield of 6 percent on 15-year bonds with a 6.35 percent coupon, which comprised most of the deal.

The city's borrowing cost was "still high, but the city had struggled to access the capital markets for the last six months and now we've done it twice in two weeks," Atlantic City revenue director Michael Stinson told Reuters. "Although it's a higher interest rate, we're happy we've been able to do this."

The cash-strapped city has seen its tax base gutted as its casinos lost value because of competition from neighboring states. Last week, it issued taxable bonds to pay off a $40 million loan from the state.

In Thursday's deal, bonds maturing in nine months sold at a 4 percent rate with a 6 percent coupon.

That defensive structure could woo investors, said NewOak managing director Triet Nguyen.

"You know that you're going to have to write down the premiums, but in exchange you're getting a very attractive coupon," he said. "Probably you will have a capital loss, but it's offset by much higher tax-exempt income."

Stinson said the premiums would cover the cost of issuance.

To back the bonds, Thursday's deal used the same state program as last week. That program funnels some of Atlantic City's state aid directly to bondholders instead of city coffers.

Such a structure makes it likely that those bonds would not be impaired if Atlantic City were to file for Chapter 9 municipal bankruptcy, the city's bond counsel told potential investors in offering documents.

That idea, however, has never been tested in court, the bond documents said.

(Reporting by Hilary Russ; Editing by David Gregorio)