The comments were made on Thursday by the president at a private event in New York.
"I want to know who's the person, who's the person who gave the whistleblower the information? Because that's close to a spy," Trump said.
"You know what we used to do in the old days when we were smart? Right?" he added. "The spies and treason, we used to handle it a little differently than we do now."
Democrats have seized on the transcript of a phone call between the president and the president of Ukraine to begin impeachment inquiry proceedings. An anonymous whistleblower first revealed the interaction.
The president also bashed Democrats and called reporters "scum" during the event.
"Basically, that person never saw the report, never saw the call, he never saw the call — heard something and decided that he or she, or whoever the hell they saw — they're almost a spy," Trump complained.
Critics accused the president of threatening a witness with the comments.
"This president is psychologically deranged, and it's only going to get worse," commented Richard Painter, a former chief White House ethics lawyer, on MSNBC.
House Intelligence Committee Chairman Rep. Adam Schiff (D-Calif.) denounced the president for the comments, saying that they amounted to witness intimidation.
"The President's suggestion that those involved in the whisteblower complaint should be dealt with as 'we used to do' for 'spies and treason' is a reprehensible invitation to violence against witnesses in our investigation," Schiff tweeted.
"All Americans must denounce such witness intimidation," he added.
Here's audio of the comments:
Listen: Trump slams whistleblower at private event www.youtube.com