TALLAHASSEE, Fla. (AP) — No matter how they exited — a loss, a resignation, a retirement — former members of Congress can pretty much do whatever they want with leftover campaign cash as long as it’s political or charitable.

Evan Bayh has kept $10 million in campaign contributions since leaving the Senate in 2011, raising plenty of questions about the Indiana Democrat’s political future or perhaps his children’s.

Mary Landrieu has more than $146,000 since her Senate loss last year and the Louisiana Democrat is talking about giving some of it to former Republican colleagues, much to the chagrin of Democrats.

Mark Foley, the Florida Republican who resigned in disgrace in 2006 after the revelation that he had sent sexually suggestive electronic messages to former male pages, is holding onto $1 million — and hoping for a political miracle.

In an age of furious fundraising, dozens of former senators and House members are sitting on tens of millions of dollars in unspent campaign money. They can’t use it for personal expenses, but they can hold onto it indefinitely, donate it to political causes or give it to charity, as former Connecticut Sen. Joe Lieberman did when he gave $815,000 to a college scholarship program.

Up until the 1970s, the one restriction placed on leftover campaign money was that it had to be spent on “lawful purposes,” including just keeping it for personal use, said Bill Canfield, a Washington-based lawyer who is an expert in campaign finance.

“It was like a savings account — once you retired you could take it home,” Canfield said.

About 35 years ago, the Senate and House revised their rules to allow the leftover money to be used only for charitable and political purposes. The Associated Press examined campaign finance reports filed through the first half of 2015. New reports are due this week.

Of his $10 million, Bayh has given away $53,700 in the past 2 1/2 years, almost entirely to Democratic candidates. That has stirred speculation of another political run, though Bayh has ruled out running for Indiana governor or an open Senate seat next year.

Dan Parker, who served two terms as state Democratic Party chair at Bayh’s request, said the former lawmaker might consider a future race.

“He is still young and does not know what the future may hold,” Parker said of the 59-year-old Bayh.

But Ann DeLaney, who managed one of Bayh’s gubernatorial campaigns and was the state Democratic Party chairman when he served as governor, suggests Bayh might be saving his money to create an instant campaign account if one of his children runs for office someday. Bayh is the son of former Sen. Birch Bayh.

DeLaney acknowledges that many Indiana Democrats are frustrated that he’s sitting on millions.

“It’s been a bone of contention here among Democrats who view it more as money for Democratic candidates rather than a personal treasure chest,” DeLaney said. “You hear complaints about it regularly, but that’s what the law allows.”

Former Massachusetts Rep. Marty Meehan left office in 2007 and is now the University of Massachusetts president. He still has $4.4 million in a campaign account, though he’s given away nearly $1.3 million, much of it to Democratic candidates and organizations, but with a good mix of charitable contributions with a focus on education, hospitals and medical research.

In Foley’s case, he has given away about $360,000 since 2010, when he began re-emerging publicly. The amount is roughly what his $1.2 million has earned through investments. He’s given most of it to local political candidates in Palm Beach County and charities representing issues related to him and his family — substance abuse, cancer and gay rights and support groups.

“At some point I’m certain I’m going to wind down the account. The likelihood of running again in the federal system is very, very remote,” Foley said, adding that a congressional run could occur, “if something miraculous happens and I believe in my heart that people would give me a second chance.”

While Landrieu has said she was open to giving some money to Republicans, there’s pressure within the Democratic Party for her not to.

“She’s going to be scrutinized. She knows that,” said Louisiana state Sen. Karen Carter Peterson, who is the state Democratic Party chairwoman. Landrieu did recently give Louisiana Democrats $25,000, Peterson said.

“What I have left will go to candidates that I believe advance an agenda of economic opportunity and social justice both in Louisiana and across the nation,” Landrieu said through a spokeswoman, “as well as to causes that I’ve fought for for decades now including adoption, foster care reform, and education reform.”