A federal report released Thursday details a shocking turf battle that broke out when immigration officials blocked law enforcement agents from interviewing a person of interest in the San Bernardino terror attack last December.

Just one day after a radical Muslim couple opened fire on office workers at a Christmas party, the FBI asked Immigration and Customs Enforcement to detain the man later determined to have supplied guns used in the attack.

When Homeland Security Investigations agents went to the U.S. Citizenship and Immigration Services office where Enrique Marquez and his wife were being interviewed, they were turned away, according to the report.

“Here, the agents were justifiably concerned that Marquez and Chernykh may pose a threat to the occupants and visitors of the USCIS facility,” the report by the Department of Homeland Security's inspector general states. “Less than 24 hours before, individuals associated with the couple had committed an atrocity on an unthinkable scale against unarmed innocents; at the time of HSI's visit to USCIS, Marquez and Chernykh’s intentions were unknown.

Homeland Security Investigations is part of Immigration and Customs Enforcement (ICE), which, like U.S. Citizenship and Immigration Services, is part of DHS.

The audit confirmed a March report by FoxNews.com and provided new details of the turf battle a day after Syed Farook and Tashfeen Malik murdered 14 people in the Southern California community.

The Inspector General's Office conducted 23 interviews and a review of email, text, and phone records from the agencies, confirmed the stunning breakdown in cooperation that first caught the attention of Senate Committee on Homeland Security and Governmental Affairs Chairman Ron Johnson, R-Wisc., in March.

"Today's report confirms whistleblower complaints I received about a dangerous lack of coordination between ICE and the USCIS,” Johnson said Thursday. “The refusal to allow armed ICE agents into a USCIS facility to detain a suspected terrorist could have had tragic consequences.”

When five agents went to the USCIS building dressed in tactical gear to detain the couple, the report said they were confined to the lobby for up to 20 minutes, and then waited another 10 minutes to meet with the USCIS field office director. The agents told the field director they were looking for Marquez, “because he was connected to the shootings and there was concern that he could be in the building,” but the field office director told agents they could not “arrest, detain, or interview anyone in the building based on USCIS policy.”

The agents also were denied a file on Marquez’s wife as well as known addresses or any other information that could lead to their apprehension, according to the report. The HSI agents waited outside for an hour before being given clearance from Washington DC to return to the USCIS offices where they were allowed to hand copy the file.

The contract security personnel at the USCIS facility should have immediately permitted entry to the HSI agents once they identified themselves – the report said - adding USCIS had no authority to restrict their access.

“The USCIS Field Director’s behavior was not only outrageous and reprehensible, but in violation of federal law and policy that ensure any law enforcement agency the ability to make arrests or conduct interviews in government facilities,” said Jessica Vaughan serves as Director of Policy Studies for the Center for Immigration Studies, a Washington, DC-based research institute. “These ICE agents are from the very same agency she works for – they are her homeland security colleagues.”

“A delay such as the one that occurred here could have disastrous consequences under different circumstances,” the report added.

Department of Homeland Security spokesman Neema Hakim said since this clash in December, changes have been made.

“ICE and USCIS have since improved their protocols for facility access and information sharing in circumstances with potential national security or public safety implications, in order to avoid any such delays in the future,” Department of Homeland Security spokesman Neema Hakim said in a statement to FoxNews.com.

USCIS agents were investigating Marquez for marriage fraud, stemming from his 2014 union with Chernykh, a Russian national married to Farook’s brother. Marquez, who is now in jail and awaiting trial this summer, is accused of supplying the guns as well as marriage fraud.

Both Farook and Malik were killed by law enforcement after their morning attack.

Marquez is already in jail and awaiting trial for conspiring with one of the San Bernardino attackers, Syed Rizwan Farook, in terror plots that never materialized.

Federal court documents obtained by FoxNews.com tied to Marquez’s case show both he and Farook abruptly halted plans for a dual terror attack in 2012. In that assault, Marquez and Farook allegedly planned to use pipe bombs and two AR-15 rifles “to maximize the number of casualties” at Riverside City College, a nearby institution they attended, and on state Route 91, a busy freeway with few exits where motorists are frequently stuck in heavy gridlock.

Marquez is also accused of supplying weapons to Farook and Malik before the Dec. 2 attack that also left 22 injured and is accused of making false statements in connection with his weapons purchases used in the San Bernardino shooting.

Marquez has pleaded not guilty to the charges filed against him. If convicted of all counts, Marquez faces up to 50 years in prison.