WASHINGTON — Donald Trump has promoted his casinos as historically successful and profitable, done in only by the economic decline of Atlantic City.

"Every building in Atlantic City is in trouble. OK? This isn't unique to Trump," he said in 2010 deposition taken as part of a casino bankruptcy.

But in the years when other Atlantic City casinos were growing, casinos carrying the Trump name weren't.

When his gambling rivals in Atlantic City were adding staff, Trump casinos were laying off employees. When Trump's publicly traded company, Trump Hotels & Casino Resorts Inc., went bust in 2004, Atlantic City's casino revenues were on their way to an all-time high. In fact, two of his casinos' three bankruptcies occurred in years when overall Atlantic City gambling revenue was rising.

On Wednesday, presumptive Democratic presidential nominee Hillary Clinton appeared in Atlantic City to take direct aim at Trump's business record there.

"His excuse for all this failure is that Atlantic City just went downhill, that it's not his fault. But don't believe it. His businesses were failing long before the rest of the town was struggling," Clinton told supporters.

Even before her speech, Trump sought to blunt Clinton's criticisms, saying on Twitter: "I made a lot of money in Atlantic City and left 7 years ago, great timing (as all know). Pols made big mistakes, now many bankruptcies."

Trump now owns no casinos in the city but says his touch there is what he'll bring to the White House: personal involvement that engenders success.

"Generally when I get involved in a company, historically, they work," Trump told members of the Nevada Gaming Control Board in early February 2004, according to a transcript. But Trump's record in Atlantic City up until then showed otherwise.

Within a few years of its initial public offering, gambling industry stock analysts at major banks stopped following Trump Hotels & Casino Resorts Inc. The company's shrunken value was simply too small to warrant attention from big-time investors. The only people on Wall Street paying attention to the company were those who followed junk bonds and distressed debt.

The underperformance itself doesn't tell the story of what went wrong. Part of the problem, by Trump's own account, was casino expansions that swamped demand.

"In New Jersey when a hotel opens up, the market shrinks for the individual hotels, and it takes a couple of years to get back to normal," he said in the 2004 Nevada gaming hearing. "When the Taj opened, it decimated the market for a period of two years."

In addition to industry overbuilding, Trump's casinos suffered from debt loads that gobbled up their profits at the tables and slot machines. Trump arranged deals between himself and the company that analysts deemed generous, most notably the 1996 sale of his personally owned Trump Castle casino to his publicly owned company, on which the company later took a big loss. In the six months following the purchase, the stock price of Trump's public company was cut by more than half.

Management played a role, too. In April of 1990, as Atlantic City's peak season began, Trump demanded that his Plaza casino cut expenses by 20 percent, according to a memoir by John O'Donnell, the onetime president of the Trump Plaza Casino.

"Get rid of some staff," O'Donnell recalled Trump ordering, suggesting that the Plaza begin by laying off a third of the waiters at the hotel restaurant. "Just do it. It's going to be a positive, believe me."

Over the next two decades, Trump's casinos shrank noticeably, according to New Jersey casino regulatory documents.

Between 1991, the first full year of the Trump Taj Mahal's operation, and 2004, the year Trump Hotels & Casino Resorts filed for bankruptcy, employment at Trump's three casinos fell from 12,757 to 10,206, a 20 percent decline. Rival casinos increased their staffing by 13 percent during that same period, as Atlantic City casinos net winnings rose from $2.9 billion to $4.8 billion, the documents show.

Trump Hotels & Casino Resorts Inc. declared bankruptcy that year, though industrywide gaming revenues continued to rise until 2006. A deal with creditors left him with a 25 percent stake and the chairmanship of the company, renamed Trump Entertainment Resorts. But creditors insisted he step aside from an operational role. Though Trump resigned as chief executive, the company continued to pay him $2 million a year for making appearances at the casinos.

Shortly after the new company was resurrected as Trump Entertainment Resorts Inc., however, Atlantic City's overall gambling industry went into steep decline, as competition in neighboring states siphoned off its customers. From 2004 until that company's 2009 bankruptcy, both the Trump casinos and the industry at large shed an additional 20 percent of their staff.

Trump's ownership survived the 2004 bankruptcy. The bankruptcy judge found Trump's name was still worth millions to the casino and approved a reorganization plan that gave him a 10 percent stake in the company in exchange for his brand's continued use.

But a third bankruptcy in 2012 wiped out Trump's remaining stake.

"Does anybody give me credit for getting out before its demise? Timing," he wrote in an August 2014 tweet amid a new wave of local casino layoffs.