BIRMINGHAM — In many ways, Atlanta and Birmingham’s home county headed down parallel paths.

Both faced huge and expensive court-ordered upgrades to their water and sewer systems. And both embraced Wall Street’s financial engineering as a way to help pay for the projects.

But the paths diverged widely last week when Jefferson County filed bankruptcy, providing an ominous reminder that Wall Street’s financial excesses continue to damage the economy and ravage municipal finances.

The same revenue engine that churned out exotic mortgages and pumped up a spectacular and disastrous housing bubble was responsible for the complicated loans that led Alabama’s largest county to financial ruin.

“There was a market demand, there was revenue to be made,” said economist Melissa Woodley, finance professor at Samford University in Birmingham. “Investment banks cooked up products designed to be revenue generators.”

Jefferson County relied heavily on risky swap agreements or variable-interest bonds on “virtually all of their debt,” said Earle Taylor III, partner and Atlanta municipal bond attorney with McKenna Long & Aldridge. They now account for roughly three-quarters of the county’s $4 billion-plus in liabilities.

The exotic products were designed in the same Wall Street environment that produced risky mortgage-backed securities. In Jefferson County, they led to soaring interest rates and unaffordable payments on massive debt.

Some Jefferson County residents blamed their political leaders for the county’s bankruptcy filing as well as some of the highest sewer rates in the country.

“Let them declare bankruptcy and take all the rest of them to jail and let’s start afresh,” said Mark Ham, 58, at Kelley’s bar in Birmingham. “My water usage is $25, and the taxes and sewer charges drive it up to $275. Jefferson County is run by a bunch of crooks.”

Some worry the bankruptcy will hurt residents more.

“I think this bankruptcy is going to mean a lot of pain for the middle-class working people and those with lower incomes,” said Sam Wilson, a 39-year-old concrete refinisher from Tarrant. “It is going to mean higher taxes, most likely, and water and sewer bills going up.”

Others were relieved. Tammy Phillips, 35, in downtown Birmingham to watch a Veterans Day parade, viewed the bankruptcy as a chance for the county to start afresh. “I sold real estate for years and the biggest complaint I got from my clients was they wanted out of Jefferson County because they were afraid of the government and the sewer rates.”

Woodley, the finance professor, said politicians agreed to deals they thought would push problems down the road.

“People knew that the payments might eventually be too high, but they thought that they would be long gone by then,” said Woodley. “There was similar thinking in housing. A lot of people believed in miracles.”

Atlanta also flirted with the exotic means to raise money, but primarily stuck to a more conservative path and so is unlikely to follow Jefferson County into financial distress. Also, bankruptcy is legally out of the question.

“Only 24 states allow municipal bankruptcy, and Georgia is not one of them,” said Michael J. Bell, professor of public finance at Georgia State University’s Andrew Young School of Policy Studies and former CFO of Atlanta and DeKalb County.

“When I was a practicing CFO, I made it a practice not to do a deal if I didn’t understand it,” Bell said. “And most people do not understand derivatives.”

While Atlanta’s swap agreements once totaled almost $1.7 billion, that equaled only about a fourth of its $6.8 billion in long-term debt. The city has since canceled most of the agreements.

Until the past decade, cities and other local governments typically financed projects using long-term bonds with fixed interest rates.

But under pressure to keep taxes low, local governments increasingly turned in recent years to complicated financing schemes known as interest rate swaps that allowed them to trim interest costs.

The multiparty deals with Wall Street firms allowed municipalities to “swap” variable interest rates for fixed rates that were lower than those on traditional bonds. But they proved riskier than expected.

During the 2008 meltdown of the financial markets, the complex arrangements fell apart. Markets that set the variable interest rates in the deals froze up, interest rates soared and firms that had provided financial guarantees lost their credit ratings.

As a result, the Wall Street firms essentially called the loans in the deals, forcing local governments to pay back loans immediately or pay huge fees to get out of the swap agreements. That hit Jefferson County especially hard, since it had used the complex deals in most of its borrowing.

JP Morgan, which arranged many of the deals, agreed to pay $722 million to settle Securities and Exchange Commission allegations that the bankers had made payments indirectly tied to county officials to win business. It is now the county’s biggest creditor.

In Atlanta, the soured swap deals haven’t wrecked finances, but the city hasn’t emerged unscathed. It was hit hardest among metro Atlanta’s municipalities, shelling out about $86 million to Goldman Sachs, JP Morgan and other firms to cancel most of its swap deals on airport and waterworks bonds.

Just as in the housing market, corruption may be blamed for some of Jefferson County’s problems — more than 20 officials have been convicted of deal-related crimes. But the lure of a great-sounding deal drew in even honest officials, said Brooklyn Law School professor David Reiss.

“Local officials are tempted by apparently easy money cloaked in newfangled terms,” he said. “They sometimes willingly suspend their disbelief in things that are too good to be true. And investment bankers remain true to their timeless temptation: profits and bonuses, pushing products that may be inappropriate on local officials, some of whom bite.”

Still, municipalities inevitably must go into the market to borrow for huge projects, said Sarah Emmans, research manager at the Pew Center on the States.

When the choice leads to disaster, there are typically a combination of reasons, she said. “There was unnecessary risk. There was also bad management. And there was bad luck.”

Two early players in the legal battles and financial maneuvering that ultimately grew into the Birmingham area’s fiasco expressed no regrets.

“It is too simplistic to blame it on derivatives,” said Steve Sayler, who was Jefferson County’s finance director when it bought its first swap agreements. “We probably went a little too far into them.”

He said the bankruptcy was largely a failure of the county’s political leadership and added the county made money from the swaps in the early days.

Lawyer Bart Slawson filed the lawsuit two decades ago that alleged the county was polluting the river systems and led to court-ordered rebuilding of the water and sewer system.

The lawsuit, he said, didn’t cause the bankruptcy, and targeted a problem that needed to be solved.

“My client came to me and asked why when I go canoeing and stick my paddle in the river, it smells like crap,” Slawson said.