Under federal law, Congress has the power to grant immunity to witnesses who testify at congressional hearings.

If two-thirds of the members of a committee vote to grant it, a request goes to a federal judge, who must issue an order granting immunity: the judge has no choice. The attorney general cannot stop it, though the Justice Department can ask for a delay of up to 20 days.

Once immunity is granted, nothing the witness says can be used in a criminal prosecution. That includes "any information directly or indirectly derived" from the testimony. In a high-profile case, especially when the testimony is televised, it's nearly impossible for a prosecutor to disentangle the testimony from other evidence. So a grant of immunity is, as a practical matter, a show-stopper for prosecutors.

Retired Lieutenant General Michael Flynn, U.S. national security advisor, arrives to a swearing in ceremony of White House senior staff in the East Room of the White House in Washington, D.C., U.S., on Sunday, Jan. 22, 2017. Andrew Harrer / Andrew Harrer/picture-alliance/d

For that reason, congressional staff will typically talk it over with the Justice Department before deciding what to do. And before granting immunity, Congress will insist on knowing what the witness would say, which is usually in the form of a written proffer.

Why the need for immunity? Because without it, a witness can refuse to answer questions citing the Fifth Amendment protection against self-incrimination. Once immunity is granted, the witness can no longer cite the Fifth and must answer.

Congress rarely grants immunity. The last time was 2007, when a Justice Department aide was called to testify about the firings of U.S. attorneys.

Defense lawyers say former National Security Adviser Michael Flynn's lawyer is smart to raise the immunity issue now, instead of waiting for a demand from the committee for testimony, then having to take the Fifth, and appearing to be dragged into testifying under immunity. This way, the witness looks eager and willing to tell his story. Two Congressional sources told NBC News on Friday that the Senate Intelligence Committee rejected the request.