ATLANTIC CITY, N.J. (AP) — Sports betting is off and running in New Jersey, with three casinos and two racetracks taking in $40.6 million in wagers in July, the first full month it was legal.

Those figures were part of a report that showed that Hard Rock debuted as Atlantic City's No. 3 casino in terms of gambling revenue out of the nine casinos in town. Ocean Resort came in last in its first full month of operation.

New Jersey won a U.S. Supreme Court case in May clearing the way for all 50 states to offer sports betting if they choose. Since betting began in New Jersey on June 14, more than $57 million in bets has been taken in, and additional companies continue to join a rapidly expanding market.

July's numbers were mainly posted by the Borgata and Ocean Resort casinos, and the Monmouth Park and Meadowlands racetracks. Bally's casino began taking sports bets on July 30.

Since then, Harrah's and Resorts have started taking sports bets as well, but their revenue will not be reported until mid-September.

And Wednesday morning, the Golden Nugget will begin taking in-person sports bets.

The Meadowlands, about 6 miles (10 kilometers) from New York City in East Rutherford, New Jersey, where the NFL's New York Jets and Giants play, took in $1.35 million in July, having started taking bets on July 14. Monmouth Park, which started taking bets June 14, took in $856,280 in July, and has won $3.1 million since mid-June.

Joe Asher, CEO of William Hill US, which runs the sports books at Monmouth Park and the Ocean Resort Casino, said he is "thrilled with the early numbers at both Monmouth and Ocean. They are clearly exceeding our expectations of where we thought we would be at this early stage. There's no doubt the New Jersey sports betting market has a lot of potential."

Jeff Gural, who runs the Meadowlands, where FanDuel operates the sports book, said "it's not a surprise, but it looks like we're going to dominate the market. The real test will come when companies get their sports book online, because that's where most of the customers are expected to come from."

The Borgata took in $562,830 in sports betting in July, and Ocean Resort handled just over $1 million. Bally's did just under $18,000 in the two days it took sports bets in July.

Sports betting generated $325,646 in state taxes in July.

The Borgata, Ocean Resort and Bally's, and the two tracks saw gross sports betting revenue of $3.8 million on those bets.

Harrah's and Resorts casinos began offering sports betting in early August.

Including all gambling revenue, the nine casinos took in $302 million in July, up 12.8 percent from a year ago. But that's mainly because two newly reopened casinos had their first full month of operation in July, including Hard Rock, the former Trump Taj Mahal. It debuted as Atlantic City's No. 3 casino out of the nine now operating in terms of revenue, with $32.7 million. It trailed only Tropicana, at $37 million, and perennial leader Borgata, which won $76.6 million in July.

Looking more closely at individual casinos, July was actually not a great month. Of the seven casinos that were operating a year ago, only the Golden Nugget showed a year-over-year increase in July, with $29.4 million, an increase of 8.8 percent over July 2017.

Harrah's was down 14.1 percent to $31.4 million and Resorts was down 12.7 percent to $17.8 million. Resorts president Mark Giannantonio said the casino did more business this July than last, but was hurt by some losses at table games.

Caesars was down 10.3 percent to $29.3 million; Bally's was down 9.9 percent to $20.5 million; Tropicana was down 9.8 percent, and Borgata was down 4.4 percent.

Ocean Resort, the former Revel casino won $17 million in its first full month, ranking it last among the city's nine casinos. Casino owner Bruce Deifik noted that July was the first time in its history that it generated a positive cash flow. He reopened the site in January after buying it from Florida developer Glenn Straub, who failed to open it for two years.

"To be ninth out of nine in this position, I'm tickled pink," Deifik said. "This was a property that for two years had a cloud over its head, people thought it was cursed, and no one thought I'd ever get it open."

Internet gambling continued its strong performance in July, up nearly 26 percent from a year ago to $25.8 million.