Show me the money! Uncle Sam is raking in millions of dollars from the record numbers of Americans giving up their citizenship each year.

The U.S. government has collected about $12.6 million in fees since fall 2014, after quintupling the amount it charges for renunciations, according to a CNNMoney analysis of official data. That's more than double the total it garnered over the six previous years.

U.S. citizens and long-term residents now pay $2,350 apiece to ditch their passports or green cards, up from $450 previously.

The higher renunciation charges have come at a time when more people than ever are cutting ties to the U.S.

Last year, 4,279 Americans bid Uncle Sam farewell, up 20% from 2014. That's 18 times as many as in 2008, and the third year in a row that's set a new record.

Increasing fees is a way for the U.S. to capitalize on the rising trend, according to Dianne Mehany, a tax attorney who assists with renunciations.

"We are in a difficult economic climate, and the government is looking for any method by which to increase revenue, defray costs," she said.

Related: Giving up your U.S. passport? It's going to cost you

The renunciation charges are far from a straightforward gain for the U.S. government's coffers, though.

The fee hike helps offset the costs for the American embassies and consulates around the world that have to process all these renunciations.

In the past, "if you had five people expatriate, it wasn't that complicated," said Chris McLemore, who handles international tax planning for expats at the law firm Butler Snow. "But if suddenly, 10 times the number of people are expatriating, you do start looking at your bottom line."

And while some U.S. citizens get slapped with a giant "exit tax" bill -- sometimes in the millions of dollars -- when they renounce, experts say it still amounts to a fraction of what the government might have generated from them in future taxes.

For expats, a higher renunciation fee is increasing the cost of what's already an expensive affair.

Even in relatively simple cases, Americans often need to spend big -- easily at least $20,000 -- hiring a team of accountants and lawyers to help with the renunciation paperwork, estimates Mehany, who works at the law firm Caplin & Drysdale.

Related: Meet 5 U.S. citizens who have given up their passports

And the high cost of saying goodbye to Uncle Sam could climb even further, according to Vincenzo Villamena of Online Taxman, a firm that specializes in filing expat taxes.

"It is a revenue generator, and as more people want to renounce, then I do see them raising the fee," Villamena said.

Many of those severing links are Americans living overseas who are tired of dealing with complicated tax paperwork, a headache that has worsened since new regulations came into effect.

Related: Uncle Sam says my Swedish kid is American

The U.S. Foreign Account Tax Compliance Act, which requires businesses around the globe to report all assets held by Americans, seeks to recoup the hundreds of billions the U.S. says it loses each year from tax evasion.

It's aimed at fat cat tax cheats, but the law has made life more difficult for expats. Some international banks have even dumped U.S. customers rather than wrestle with the complicated law.

But getting rid of Americans doesn't mean banks can wash their hands of the situation entirely. For example, they still need to develop a process to identify new Americans looking to open accounts, according to the U.S. Treasury.

Related: Nobody escapes U.S. taxes - even astronauts

Many expats say tossing the blue passport is a practical choice, but it's certainly not an easy one to make.

Donna-Lane Nelson, who gave up her U.S. citizenship in 2011, said she threw up outside the embassy after renouncing.

"I broke down," she said. "It was like getting a divorce. America gave me my education, a good career path, and I came from a beautiful part of the country. This was very hard."