WASHINGTON—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.

The counterintelligence inquiry aimed to determine the nature of Mr. Flynn’s contact with Russian officials and whether such contacts may have violated laws, people familiar with the matter said.

A key issue in the investigation is a series of telephone calls Mr. Flynn made to Sergey Kislyak, the Russian ambassador to the U.S., on Dec. 29. That day, the Obama administration announced sanctions and other measures against Russia in retaliation for its alleged use of cyberattacks to interfere with the 2016 U.S. election. U.S. intelligence officials have said Russian President Vladimir Putin ordered the hacks on Democratic Party officials to try to harm Hillary Clinton’s presidential bid.