Federal workers who lose pay during the government shutdown can fall back on unemployment benefits in most states.

But the money comes with a catch. If Congress decides later to retroactively pay those workers, they would have inadvertently double-dipped into the system and will be asked to return the money.

It's not clear whether furloughed workers will eventually receive paychecks or not, once the shutdown ends. But that's how it played out during the government shutdown in 1995 and 1996, after which, state agencies tried to recoup the overpaid funds.

Related: Shutdown may force me into bankruptcy

Now, on day one of the latest shutdown, states with large numbers of federal employees like Maryland, Virginia and Pennsylvania have already posted advisories on their sites, indicating they plan to ask for the funds back, in the event that they overpay unemployment benefits to federal workers.

"If you receive back pay from your agency to cover the furlough period, you must repay any unemployment benefits you received for that time," the Virginia Employment Commission said in a Q&A on its site.

Who qualifies for unemployment benefits?

The laws vary by state, but here's how it generally works:

Federal employees can be divided into two basic categories. First, those who are deemed "essential" and asked to report to work. Their pay may be delayed, but they are guaranteed their usual wages and thus, will not be eligible for unemployment benefits.

But their "non-essential" colleagues will be forced to take days off without pay until Congress reaches a budget agreement. These workers may file for unemployment because they're on a temporary layoff through no fault of their own.

Related: How is the government shutdown affecting you?

The specific eligibility requirements vary by state and payouts usually differ based on a worker's salary and the length of the furlough. It's safe to say, however, that if the shutdown lasts at least a week, most furloughed employees will be eligible for benefits in the states where they work.

The U.S. Department of Labor has issued a fact sheet, advising employees that they may file for unemployment benefits on the first day of their furlough, but it may take two to three weeks for the claims to be processed.

If payments have to be recouped, the entire process is likely to prove a paperwork nightmare for both workers and state unemployment agencies. California, the state with the largest number of federal workers, is already dealing with a huge backlog of unemployment claims after federal budget cuts led to a staffing shortage.

"This will significantly add to the daily workload of processing UI claims here in California," said Kevin Callori, a California Employment Development Department spokesman in a statement. "We are already struggling to manage daily workload."

Regardless of how the situation plays out, David Ricksecker, an attorney with Woodley & McGillivary, advises furloughed employees to file for the benefits right away. Workers should not assume Congress will retroactively pay lost wages, he said.

"If someone has rent due, it's better to get unemployment and pay it back later if you need to," he said. "Congress is so far apart on everything that I don't see them voluntarily going back and paying these employees, but I could be wrong."