A key unit of the Department of Homeland Security has slipped into a state of financial turmoil that could endanger its ability to investigate terrorists, pay informants and perform wiretaps, some department employees and officials say.

All hiring and transfers at the department's Immigration and Customs Enforcement (ICE) division have been banned for two months, as have almost all training, purchases of supplies and equipment, and maintenance of vehicles. Top department officials say they are committed to protecting ICE's ability to perform investigations, but agents in the field say ICE's budget shortfall of perhaps $500 million may soon threaten its national security work.

The cause of the financial hole at ICE is a set of complex accounting maneuvers used when the Department of Homeland Security was established in 2003. Those procedures have led to financial disputes among several Homeland Security agencies, officials said.

ICE has a diverse mission that includes investigating immigration violations, international arms dealers, money launderers and child pornographers. It is participating in the government effort to disrupt possible terrorist threats during the election period. It is an amalgam of parts of the old Customs Service, the former Immigration and Naturalization Service (INS), and other agencies.

Top Homeland Security officials are hiring outside accountants to help referee the disputes, which involve hundreds of millions of dollars, among the three Homeland Security agencies that include parts of the old INS: the 15,000-employee ICE; Customs and Border Protection (CBP), whose 41,000 employees guard U.S. borders, airports and seaports; and the 10,000-strong Citizenship and Immigration Services (CIS), which provides services for immigrants.

"These are very frontline agencies, and getting them healthy as fast as possible is what we're about," said Andrew Maner, Homeland Security's chief financial officer, who has overseen 10 months of intense negotiations among the three agencies. "We need to have very healthy agencies, given what they do."

One result of ICE's budget crisis is that it has been forced to release on bond 25,000 illegal immigrants over the past year because it lacked space to incarcerate them, said Rep. Jim Turner (Texas), the ranking Democrat on the House Select Committee on Homeland Security. "That's a dangerous situation that needs management attention," he said.

ICE officials disputed the number, adding that they did not release any convicted criminals or people suspected of posing terrorist threats.

ICE officials said they do not plan layoffs or furloughs, and that they are doing everything they can to avoid compromising investigations. In a Sept. 3 e-mail to employees announcing the need for deeper budget cuts, ICE chief Michael Garcia said they were necessary "to ensure we operate within our budget while continuing to direct resources towards our national security missions, which are our highest priority."

"The message has been sent to the field to make sure they continue to fulfill that mission," ICE spokesman Russ Knocke said.

ICE agents around the country confirmed that their superiors are trying to avoid limiting investigations. But it has become clear that ICE will overspend its current budget of $3.8 billion, even with the cutbacks it is making, ICE officials and agents said. It is illegal for an agency to overspend its congressionally approved budget.

The budget picture varies office by office, employees said. Most larger offices have been able to keep cars running and agents active because they have more budget flexibility, but some smaller field offices are taking cars off the streets, restricting photocopying and cutting agents' budgets, officials said.

"My bosses are saying, 'Don't ground the fleet, because that affects operations,' and so we haven't," said an official at a large ICE office. "But it's not possible to meet our budgets" without cutbacks that would sideline agents' vehicles, he added. "We're on track to overspend."

The origins of ICE's budget problems hark back to the way the former agencies were broken up and reassembled into three new entities inside Homeland Security. It has led to bitter clashes among the three new agencies -- ICE, CBP and CIS -- over how much each owes the others for providing an array of expensive services to one another.

The disputes involve hundreds of types of cash outlays, including the computer work that ICE provides the other two agencies; and ICE's payment of rent and parking costs to the other agencies in some field offices. All three claim they should be repaid for various costs they incur for the other agencies, but ICE is by far the overall loser, officials said.

In merging the various parts of the old Customs and INS, Congress and the White House decided that the new Homeland Security entities should not create their own units to handle information technology, human resources, payroll, legal and other services, officials said. To economize, the three agencies were each assigned to handle some of the tasks for the others, and instructed to settle the costs later. But the task has turned out to be much more difficult and disruptive than anyone predicted, officials said.

ICE has been plagued by employee discontent since it was formed, along with the Department of Homeland Security, in March 2003. Many former Customs agents, who prided themselves on high performance and esprit de corps, resented being put together with agents from the old INS and being forced to pursue sometimes humdrum cases involving alien smuggling rings and fraudulent marriages.

Many former Customs agents also express bitterness about using ICE's computerized budget- and case-tracking systems, which used to belong to the INS and had been criticized by outside auditors for years. A number of ICE employees and members of Congress say ICE's internal financial systems are one cause of ICE's current budget crisis -- an assertion ICE officials deny.

The Homeland Security appropriations bill approved earlier this month notes that lawmakers are "extremely concerned about the financial health of ICE, and whether it has the systems and management in place to support the functioning of the agency.

"The adverse impact of hiring and spending freezes and uncertainty on the operations of this critical agency and the morale of its personnel cannot be ignored," according to language in the law.

In tense bargaining over last fiscal year's budget, Homeland Security officials persuaded the three agencies to repay each other for various services. ICE was given $500 million, with CBP paying $215 million of that, and CIS providing $270 million. ICE also saved $120 million through cutbacks in the past fiscal year, which ended on Sept. 30.

Now the three agencies are locked in negotiations for the current fiscal year, with each saying it is owed money, and ICE warning it might not be able to do its job under its current budget. The accountants are looking at such seemingly trivial cost-allocation questions as how much each agency pays for photocopiers in each field office and the share of copying by employees of each of the three agencies.

"This is incredibly complex," said a Homeland Security official briefed on the controversy. "But ICE's new budget [from Congress] has a huge projected hole in it. . . . This situation has to be resolved immediately."