U.S. counterintelligence agents have investigated communications that President Donald Trump’s national security adviser had with Russian officials, according to people familiar with the matter.

Michael Flynn is the first person inside the White House under Mr. Trump whose communications are known to have faced scrutiny as part of investigations by the Federal Bureau of Investigation, Central Intelligence Agency, National Security Agency and Treasury Department to determine the extent of Russian government contacts with people close to Mr. Trump.

It isn’t clear when the counterintelligence inquiry began, whether it produced any incriminating evidence or if it is continuing. Mr. Flynn, a retired general who became national security adviser with Mr. Trump’s inauguration, plays a key role in setting U.S. policy toward Russia.