WASHINGTON – President Donald Trump lashed out angrily on Thursday at whoever provided a whistleblower with details of his phone call with the president of Ukraine, calling the source of the leak “almost a spy” and suggesting the culprit had committed treason.

“You know what we used to do in the old days when we were smart with spies and treason, right?” Trump said, according to published reports. “We used to handle it a little differently than we do now.”

Trump’s remarks, made at a private event in New York, came as the whistleblower’s complaint was made public and was the subject of a hearing before the House Intelligence Committee. The complaint has prompted House Democrats to open an impeachment inquiry into Trump.

The whistleblower, whose identity has not been made public, revealed deep concern that Trump “used the power of his office” to solicit Ukraine’s help to discredit one of his main political rivals, former Vice President Joe Biden.

The complaint went on to detail efforts by senior White House officials to later "lock down" access to all records of the July 25 call with Ukrainian President Volodymyr Zelensky in which Trump urged his counterpart to investigate Democratic presidential candidate Biden and his son Hunter Biden.

More:Trump's efforts to discredit Joe Biden backfired on him. Will they hurt the former VP anyway?

In New York, Trump reportedly told staff from the United States Mission to the United Nations on Thursday that he wants to know who leaked the information.

“I want to know who’s the person who gave the whistleblower the information because that’s close to a spy,” he said.

The Los Angeles Times, which reported Trump’s remarks, said it had obtained a recording of Trump’s comments from a person attending the event. The New York Times also published an account of Trump’s remarks.

Bruce Udolf, a former federal prosecutor who served as an associate independent counsel during the Whitewater investigation involving President Bill Clinton, said Trump’s remarks could expose him to potential obstruction of justice or witness tampering charges.

“It’s not clear to me if Trump is more stupid than he is arrogant,” Udolf said, adding that a summary the White House released of the president's conversation with his Ukrainian counterpart also demonstrated that Trump “hasn’t been terribly loyal to his country, either.”

On Capitol Hill, congressional Democrats expressed outrage at Trump’s comments.

Sen. Michael Bennet, D-Colo., called them “reprehensible.”

Rep. Adam Schiff, the California Democrat who chairs the House Intelligence Committee, wrote on Twitter that Trump's remarks are "a reprehensible invitation to violence" against witnesses in the committee's investigation.

Rep. Val Demings, D-Fla., also condemned Trump’s remarks.

“Whistleblowers who follow the rules, as this one did, are vital to protecting our safety and our freedoms,” she wrote on Twitter. “For the president to threaten this patriotic American with death demonstrates what prosecutors call ‘consciousness of guilt.’”

Contributing: Savannah Behrmann

More:Trump administration releases details of call with Ukrainian President Zelensky amid impeachment inquiry

More:Trump administration releases details of call with Ukrainian President Zelensky amid impeachment inquiry

More:Ukraine's Volodymyr Zelensky on Trump phone call: 'Nobody pushed me'

More:New poll: Majority of Americans against impeachment and removal of Trump