President Donald Trump rails against the media's use of anonymous sources, but reporters say Trump himself has been an anonymous source many times over the years.

Addressing supporters Thursday at a rally for Montana Auditor Matt Rosendale, a Republican running for Senate, Trump claimed that the media often fabricate sources:

They quote sources. 'A source within the Trump Organization said.' A source. They don't have a source. They never use names anymore. The old days, you have to use names. 'Jim Smith said that Donald Trump is a bad guy.' They don't do that anymore. They say 'a source within the administration.' They make the sources up. They don't exist in many cases….I saw one of them said 15 anonymous sources. I don't have 15 people—forget it. 15 anonymous sources have said all source of stuff. These are really bad people.

Trump's "anonymous source schtick is complete BS," Fox Business correspondent Charles Gasparino then said on Twitter. "Just heard @POTUS at this rally complaining about the use of anonymous sources," Gasparino tweeted. "For the record he was one of mine over the years."

Just heard @POTUS at this rally complaining about the use of anonymous sources. For the record he was one of mine over the years. — Charles Gasparino (@CGasparino) July 5, 2018

I'm ok w @POTUS personally always got along w him but this anonymous source schtick is complete BS he knows it — Charles Gasparino (@CGasparino) July 5, 2018

Gasparino wasn't the only one who Trump would speak to as an unnamed source, according to Paula Froelich, a writer who used to work for the New York Post. "I believe he was all of ours," she wrote in response to Gasparino.

I believe he was all of ours https://t.co/34KagaE2Ak — Paula Froelich (@Pfro) July 6, 2018

In fact, reporters have been saying for years that Trump used to pose as an anonymous source. According to Axios' Jonathan Swan, Trump was known as "one of the Manhattan media's most notorious anonymous sources" during his days as a real estate tycoon. He was also notorious for pretending to be his own publicist, using aliases like "John Barron" or "John Miller" to brag about himself in conversations with reporters.

That sort of behavior hasn't necessarily ended. In his book The Trump White House, released in April, Ronald Kessler claims that the president still speaks to reporters as an unidentified source. "Trump phones Maggie Haberman of the New York Times directly, as well as Philip Rucker of the Washington Post, and Jonathan Swan of Axios, feeding them stories attributed to 'a senior White House official,' creating the impression the White House leaks even more than it already does," Kessler writes.

Trump's habit as a serial anonymous source looks even more hypocritical in light of his administration's war on leaks. Last August, Attorney General Jeff Sessions indicated the Department of Justice may be willing to subpoena reporters to trace leaks, and last month it followed through by demanding the phone and email records of New York Times reporter Ali Watkins in an attempt to find out whether her source, a former Senate aide, had leaked classified information. As the Times notes, this move suggested that Trump administration prosecutors "will continue the aggressive tactics employed under President Barack Obama."

According to former Times reporter James Risen, who fought the Obama Justice Department's attempts to force him to reveal his confidential sources, just three cases "involving leakers and whistleblowers" were prosecuted by previous administrations. During the Obama administration, nine such cases were prosecuted.