Tens of thousands of miners were on strike and coal prices were skyrocketing in October 1902. Afraid of unrest, President Theodore Roosevelt sought the help of John Pierpont Morgan.

The powerful banker, who held great sway over the coal industry, brokered a deal with the miners that ended the strike.

“My dear sir,” the president wrote to Morgan. “Let me thank you for the service you have rendered the whole people.”

America’s coal industry is now facing another dark hour, but this time there are few financiers willing to save it.

Morgan’s bank, now JPMorgan Chase, announced two weeks ago that it would no longer finance new coal-fired power plants in the United States or other wealthy nations. The retreat follows similar announcements by Bank of America, Citigroup and Morgan Stanley that they are, in one way or another, backing away from coal.

While coal has been declining over the last several years, Wall Street’s broad retreat is an ominous sign for the industry.

“There are always going to be periods of boom and bust,” said Chiza Vitta, a metals and mining analyst with the credit rating firm Standard & Poor’s. “But what is happening in coal is a downward shift that is permanent.”

On Wednesday the world’s largest private-sector coal company, Peabody Energy, said it might have to file for bankruptcy protection, following a path taken by three of the nation’s other large coal companies.

Peabody has been trying to sell three of its mines in Colorado and New Mexico to raise cash. But the sale to Bowie Resource Partners appears to have stalled amid the difficult financing environment. Bowie did not comment. A Peabody spokesman said the company “stands ready to complete the sale of assets to Bowie.”

Coal, like railroads, steel and other engines of the nation’s industrial expansion in the 19th and early 20th centuries, helped drive Wall Street’s profits for generations. More than a century later, the coal industry is in a free fall and the banks are pulling away.

“Given the state of the coal industry today, I think Mr. Morgan himself might make the same decision,” said Jean Strouse, a biographer of the banker.

Some banks say they are trying to do their part to curtail climate change by moving away from coal projects and financing ventures that produce less carbon. But bankers also say there is a more basic reason for the shift: Lending to coal companies is too risky and could ultimately prove unprofitable.

Coal companies are being squeezed by competition from less expensive energy sources like natural gas and by stiffer regulations — pressures that show no signs of letting up.

As a result, even the most secure loans — like those made to companies emerging from bankruptcy, known as debtor-in-possession loans — are increasingly off limits for many banks, according to bankers and industry lawyers.

And it is not just big banks. Even many more daring investors like hedge funds and private equity firms, which are usually eager to pounce on industries in distress, are shying away from coal because of deep uncertainty about its future.

It is a starkly different scene in the oil industry, where investors are raising hundreds of millions of dollars to snap up the debt and equity of troubled companies that are struggling with an oversupply of oil. Despite the immediate stress, many investors expect the oil glut will burn off by next year and prices will rebound.

In the coal country of Appalachia, however, it is unclear whether many unprofitable mines can ever make money again.

“There is certainly no $40 billion titan looking to make a big play in coal right now,” said Marshall Huebner, co-leader of the insolvency and restructuring practice at Davis Polk & Wardwell who has represented several coal companies in recent bankruptcies.

Despite the challenges, the coal industry still powers roughly a third of the nation’s electricity. Industry officials say the business will eventually bounce back, once supplies burn off and demand for coal rebounds in places like China.

“Coal is part of our future, and I think the banks are taking a shortsighted view,” said Mike Duncan, president of the American Coalition for Clean Coal Electricity, an industry group. “They are ignoring a huge market and buying into rhetoric that just doesn’t work.”

Environmental groups, meanwhile, are hoping the banks’ reluctance will hasten the collapse of coal. Groups like the Rainforest Action Network have been pressuring banks for months to reduce coal lending.

“With much of the world committed to stabilizing the climate, we need the banks to follow quickly with measures to end coal financing altogether,” said Ben Collins, a senior campaigner at Rainforest Action Network.

But the banks’ retreat could inflict collateral damage on an industry that employs tens of thousands of workers and needs financing not only to keep operating, but also to clean up coal mines after they close. If coal companies are unable to pay for the mine reclamation, taxpayers could be on the hook for the cleanup costs.

As big American lenders pull back, a few foreign banks, like Deutsche Bank, have been willing to step in, industry officials say.

In its latest annual corporate responsibility report, Deutsche Bank said it was phasing out financing for projects that employ mountaintop removal mining, which environmentalists say is particularly harmful. But the bank’s policy statement did not commit to the type of broad reduction in coal exposure that many U.S. lenders have made in recent months.

In a statement, a bank spokeswoman said Deutsche Bank is one of the “most prominent banks when it comes to clean energy financing.” She added that the bank “has very strict guidelines governing any financing decisions. We conduct a thorough and detailed analysis on a case-by-case approach, drawing on a deep understanding of wider socioeconomic and environmental trends.”

Even most U.S. banks are not cutting off funding to the industry overnight, saying that for the moment coal remains a major source of energy, particularly outside the United States.

JPMorgan, for instance, is halting financing of new coal-fired plants in wealthy nations like the United States, but will continue to lend to such plants in the developing world, where the coal market is still thriving. To receive financing, however, these plants need to use certain environmentally sound technologies, according the bank’s new policy.

Changes to the coal lending policy at Bank of America have created tension between senior leadership and rank-and-file bankers.

Senior leaders wanted the bank’s energy lending strategy to reflect “a transition from a high-carbon to a low-carbon economy,” said James Mahoney, who oversees public policy issues at the bank and worked on the new coal policy. It is part of Bank of America’s current effort at “responsible growth” — which entails not taking undue risks like lending to a troubled industry, Mahoney said.

But the shift has been uncomfortable for some of the bankers serving the coal industry.

“It put them in a difficult position to say to the companies they have worked with for years, ‘We are pulling back,’” Mahoney said. “It runs counter to everything we do as a client-focused company.”

Speaking at an environmental conference at the United Nations in January, Bank of America’s chief executive, Brian T. Moynihan, acknowledged the internal tensions around coal but said that the bank was trying to pull back gradually from the sector.

“When you have real clients involved, these decisions get difficult,” Moynihan said. “But I think the view of the people working on it is: We have to help people make the transition.”

That transition seemed to accelerate last week with the warning from Peabody that it would miss $71 million in interest payments.

One of Peabody’s best hopes for avoiding bankruptcy, analysts said, was the potential sale of three mines to Bowie Natural Resources.

Bowie is a rare breed of coal company. It has been expanding its operations, focusing largely on Utah, a state that still relies primarily on coal to generate electricity. Still, Bowie in recent weeks has apparently had trouble raising the full $650 million in debt to acquire the mines.

In many debt deals, banks would cover the shortfall. But Deutsche Bank and Citigroup agreed only to make their best effort to raise the debt for Bowie. The banks did not commit any of their own money, as a traditional underwriter might do.