Roughly 42,000 active-duty military members of the Coast Guard will receive paychecks on Dec. 31 despite the federal government shutdown, a Coast Guard spokesman told NBC News on Friday night.

The one-time payment for active-duty members, reservists who were active in December, and retirees is part of a short-term solution agreed upon by the Trump administration, the Department of Homeland Security, and the Coast Guard, according to a blog operated by the Coast Guard.

"The circumstances of this lapse are unique because of the timeline of the lapse in relation to the military pay process," the blog, published Friday, read. "Ultimately, extensive research and legal analysis between the Coast Guard, DHS, and [Office of Management and Budget] determined the Coast Guard has the authority to execute the remainder of pay and allowances for December."

The Coast Guard is the only part of the military under DHS, rather than the Department of Defense which continues to be funded during the shutdown.

Coast Guard members are still working to provide essential services such as search-and-rescue operations during the shutdown but will not be paid into January unless Trump and Congress can agree to an appropriations bill before the next pay period or provide an alternative solution.

President Donald Trump told Congress last week that he would refuse to sign a stopgap measure to fund the government unless it included $5 billion for a border wall, which Senate Democrats have refused to approve.

Unless an agreement on border-wall funding can be reached, Trump has threatened that the shutdown could last a "very long time."