Michael Atkinson, Inspector General of the Intelligence Community, leaves a meeting in the U.S. Capitol October 4, 2019 in Washington, DC after meeting with the House Select Committee on Intelligence today in the ongoing impeachment inquiry against U.S. President Donald Trump.

President Donald Trump has informed Congress that he is removing the inspector general who flagged the Ukraine whistleblower complaint, according to a letter obtained by NBC News.

"This is to advise you that I am exercising my power as President to remove from office the inspector general of the intelligence community," the Trump letter to the leaders of the House and Senate intelligence committees says.

The letter also says "it is vital that I have the fullest confidence in the appointees serving as Inspectors General. That is no longer the case with this Inspector General."

The firing is to take effect 30 days from Friday, according to the letter.

News of the complaint and the fact it had been withheld from Congress touched off an inquiry and testimony that resulted in Trump's impeachment. Trump was acquitted by the Senate.

Michael Atkinson deemed the complaint an "urgent concern" that he was required by law to provide to the congressional intelligence committees.

But Acting Director of National Intelligence Joseph Maguire refused to do so on the advice of the Justice Department, resulting in a standoff.

More from NBC News:

Kathleen Kennedy Townsend's daughter, grandson presumed dead after canoeing accident

Making your own face mask? Some fabrics work better than others, study finds

Trump was accused of abusing the power of his office for personal political gain and obstruction of Congress.

House Democrats said there was ample evidence that Trump had abused his power by pressuring Ukraine to announce investigations into former Vice President Joe Biden and his son while withholding almost $400 million in aid, and that he had obstructed Congress by refusing to release any documents related to his actions.

Atkinson is a Trump appointee who was confirmed by the Senate in 2018. He is a career Department of Justice prosecutor.

"President Trump's decision to fire Intelligence Community Inspector General Michael Atkinson is yet another blatant attempt by the President to gut the independence of the Intelligence Community and retaliate against those who dare to expose presidential wrongdoing. At a time when our country is dealing with a national emergency and needs people in the Intelligence Community to speak truth to power, the President's dead of night decision puts our country and national security at even greater risk," House Intelligence Committee Chairman Adam Schiff said in a statement Friday night."

"It undermines the transparency and oversight the American people expect of their government, and in its absence will undoubtedly lead to even greater corruption in the Administration," he said.