 -- While President Trump's controversial executive order on immigration caught much of official Washington off guard, congressional staffers secretly worked on the measure without the knowledge of many lawmakers, sources told ABC News.

Sources briefed on the process said that House Judiciary Committee staffers worked on the immigration order after the election as part of their work with the Trump transition team.

At least one committee staffer signed a nondisclosure agreement regarding the work, a source familiar with the matter told ABC News.

While it's common for congressional staffers to volunteer with presidential transition teams, the signing of nondisclosure agreements is highly unusual, if not unprecedented, congressional sources said.

News of the nondisclosure agreements was first reported by Politico.

Trump's executive order — which imposed "extreme vetting," suspended most travel to the U.S. from seven predominantly Muslim countries and banned Syrian refugees indefinitely — caught congressional leaders by surprise when it was announced late last week. Many said they learned about it through the news media.

Work on the order and its unveiling was led by Stephen Miller, Trump's senior policy adviser, who worked extensively on immigration issues in the office of Sen. Jeff Sessions, R-Ala.

On Tuesday, House Speaker Paul Ryan said he became aware of the executive order "at the time it was being issued" and he was briefed "as it rolled out." He added he had a "good" conversation with John Kelly, the secretary of the Department of Homeland Security, on Monday and they agreed in the future to "make sure things are done correctly."

House Judiciary Committee Chairman Bob Goodlatte, R-Va., told members in the House GOP Conference meeting today that he gave his staffers permission to volunteer for the transition and that work ended on Jan. 20, according to multiple sources.

He did not indicate whether he knew about the nondisclosure agreements and this particular executive order, but sources said he insisted that his staffers had nothing to with the roll out of the order, which he echoed in a statement after the meeting.

"My staff on the House Judiciary Committee are some of the best on Capitol Hill. They are experts in their respective fields, and I proudly allowed them to provide their expertise to the Trump transition team on immigration law," he said in a statement Tuesday morning.

"To be clear, while they gave advice to the new administration, they did not have decision-making authority on the policy," he continued. "The final decision was made at the highest levels of the Trump administration, and I support the president's executive order. My staff had no control of the language contained in the president's executive order, the timing of the announcement, the rollout and subsequent implementation and the coordination with Congress. I am proud of my staff — they are an asset to me, Congress and the American people."

Ryan downplayed the controversy, insisting it was normal for congressional staffers to work with the administration to craft policy. He deferred to the House Judiciary Committee on further details and was not asked directly about the nondisclosure agreements.

He stressed that it is the president's chief responsibility to keep Americans safe but admitted it is "regrettable" that there was confusion over the weekend on the particulars of the executive order.

Ryan dismissed criticism of the order, pointing to the SAFE Act, which passed through the House in the wake of the 2015 Paris attacks. He said that he is supportive of the government's refugee resettlement program but that it requires proper review and vetting.

"There is nothing wrong with taking a pause," he said.

One former senior Republican leadership aide expressed disbelief about the nondisclosure agreements, stressing that signing the agreements may violate legislative staffers' employment contracts and raises questions about separation of powers.

"This isn't something that I've ever considered, because any routine interparty cooperation is usually handled with a handshake and trust," the source told ABC News. "I've never seen it like this."

The source said requiring the agreements "makes it even more remarkable because it's a pledge to never to tell [employers] about the work."

"You simply do not do side jobs that affect your boss without consulting your chief or the chairman," the source continued. "Cooperation is one thing. Hijacking staff without consent is another."

Another former GOP leadership aide said he believes the nondisclosure agreements are a major problem. "That is unheard of and should be a fireable offense," he told ABC News.