The Department of Homeland Security transferred $169 million from other agencies to Immigration and Customs Enforcement for the detention and removal of migrants this year, according to a document sent to Congress by DHS.

Many of the transfers came from key national security programs, including $1.8 million from the Domestic Nuclear Detection Office, $9.8 million from FEMA, $29 million from the U.S. Coast Guard and more than $34 million from several TSA programs. DHS also transferred $33 million from other ICE programs to pay for detention and removal, making the total amount of money transferred $202 million.

The FEMA and Coast Guard transfers were first reported by "The Rachel Maddow Show." On Tuesday night, Sen. Jeff Merkley, D-Ore., announced on the show that nearly $10 million was moved from FEMA's budget to ICE. The budget document Merkley cited, which was later released and publicized by the DHS Watch program at America's Voice, an advocacy group based in Washington, showed a breakdown of how DHS moved money between different programs and agencies.

The department has the authority to move funds around internally with the approval of Congress and transfers are not unusual. The total DHS budget for fiscal 2018 was $65 billion; FEMA's total budget was $15.5 billion.

DHS spokesperson Tyler Houlton tweeted Tuesday night that, "Under no circumstances was any disaster relief funding transferred from @fema to immigration enforcement efforts. This is a sorry attempt to push a false agenda." He also said that the transferred money came from routine operating expenses and "could not have been used for hurricane response due to appropriation limitations."

On Wednesday, FEMA director Brock Long told Andrea Mitchell, chief foreign affairs correspondent for NBC News, that none of the $10 million transferred from FEMA to ICE came from the Disaster Relief Fund, saying that Merkley was "playing politics" ahead of Hurricane Florence.

"Right now, that money has nothing to do with what you see behind us," he said in an interview from the FEMA response center in Washington.

View this graphic on nbcnews.com

However, money was taken from the response and recovery, preparedness and protection and mission support operations budgets, which are used to prepare for emergencies like Florence. Those FEMA budgets are for "training for all hazards, preparing our warehouses, making sure we have things ready to go so that we can pre-deploy like you see FEMA doing now," Moira Whelan, FEMA's former chief of staff for the office of Gulf Coast rebuilding, told Maddow on Wednesday. "Taking money away from that operation doesn't just harm [FEMA's hurricane response], it harms us with any disaster we face."

DHS did not immediately respond to a request for comment about the other transferred funds.

DHS stated in the document that the transfers to ICE were made due to "increasing operational demands." The transfers were requested so ICE could add more than 2,000 detention center beds on top of 38,000 adult beds it predicted it would need in its initial budget request for the year. Those beds cost an additional $93 million above the allocated budget, according to the document provided to Congress.

The number of detained migrant children in federally contracted shelters has also increased, growing fivefold in the past year, The New York Times reported Wednesday.

ICE also expanded two kinds of flight operations as part of its removal program, increasing the cost of the already $369 million program by $107 million. Its daily air charter services alone increased by 28 percent this year.

The AP reported Wednesday that according to the office of Sen. Patrick Leahy of Vermont, DHS notified Congress on June 30 that it wanted to transfer $200 million from other agencies to ICE, including the funds from FEMA. Leahy, the ranking Democrat on the Senate Appropriations Committee, said the transfer was approved by the Republican subcommittee chairs and no Democrats signed off on it.

The transfers occurred in August. Ur Jaddou, director of DHS Watch, called the reshuffling of funds an example of "upside down priorities."

Jaddou said the document suggests the Trump administration would rather separate families "and detain and deport parents [than] prepare for hurricanes."