Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — President Donald Trump's original travel ban was rushed into effect so quickly that front-line border and customs agents were caught by surprise, leading to confusion and violations of court orders, according to a report by the Department of Homeland Security inspector general.

The report, yet to be publicly released, largely confirmed news reports about airport chaos during the week the executive order was in effect from Jan. 27 to Feb. 3.

Leaders of Customs and Border Protection (CBP), the agency most involved in carrying out the ban, "had virtually no warning that the executive order was to be issued or of the scope of the order," said Inspector General John Roth, in a letter to members of Congress sent late Monday.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Some agents "went the extra mile and provided water and food from their own personal funds" and largely complied with the flurry of court orders that came in the hours after the ban was imposed. But the report faulted CBP leadership for being "very aggressive" in preventing U.S.-bound passengers from boarding some flights, in violation of court rulings.

CBP tried to prevent Boston-bound travelers from boarding flights, despite a court order requiring agents to tell passengers just the opposite, the inspector general said, and the agency continued to issue "no board" instructions after another court order forbid it from doing so.

Roth said his report was finished in early October but that public release has been held up by Homeland Security leadership. "I am very troubled by this development," he said, adding that he was concerned DHS leaders were abusing their privilege to review pending reports for improper disclosure of internal decision making.

"Invoking privilege can mask discovery of decisions made based in illegitimate considerations, or evidence of outright misconduct," Roth said.

Photos: ‘Trump Out, Refugees In’: Ban Sparks Protests at Airports Across the Nation

But DHS spokesman Tyler Houlton said some of the material in Roth's report is covered by well-recognized privileges against disclosure, given that "many of the activities in implementing the executive order were conducted amidst a large number of lawsuits and later court orders that shaped the department's response."

He said DHS officials conducted themselves "professionally and in a legal manner" in putting the travel ban into effect.

Revised versions of the travel executive order have since lapsed and were replaced by a presidential proclamation limiting travel from countries that do not conform to strict new requirements for vetting the backgrounds of people seeking visas.