A Chinese state-owned company reportedly hacked former Secretary of State Hillary Clinton’s email server, then inserted code that forwarded them a copy of virtually every email she sent or received after that -- a revelation President Trump is demanding be investigated.

The Daily Caller reported that the firm operating in the D.C. area wrote code that was then embedded in the server and generated a “courtesy copy” for almost all her emails -- which was then forwarded to the Chinese company.

The code reportedly was discovered in 2015 by the Intelligence Community Inspector General (ICIG), which then warned FBI officials of the intrusion.

A source briefed on the matter confirmed to Fox News the details of the Caller’s reporting, and said that the ICIG was so concerned by the revelation that officials drove over to the FBI to inform agents -- including anti-Trump agent Peter Strzok -- of the development after it was discovered via the emails' metadata.

The source told Fox News the hack was from a Chinese company, describing it as a front for Chinese intelligence.

A second source briefed on the matter told Fox News that officials outside of the FBI indicated code on the Clinton server suggested a foreign source was receiving copies of emails in real time.

The hacking report caught the attention late Tuesday of President Trump, who warned that the FBI and DOJ should act or “their credibility will be forever gone.”

Chinese Foreign Ministry spokeswoman Hua Chunying responded to Trump’s tweet, saying: "This isn't the first time we've heard similar kinds of allegations.”

"China is a staunch defender of cybersecurity. We firmly oppose and crack down on any forms of internet attacks and the stealing of secrets," she said, according to Reuters.

The ICIG and the FBI declined to comment.

Clinton's office did not respond to a request for comment, but a spokesman told The Daily Caller, “The FBI spent thousands of hours investigating, and found no evidence of intrusion. That’s a fact.”

Fox News reported in March that Strzok was advised of an irregularity in the metadata of Clinton’s server that suggested a possible breach, but no follow-up action was taken.

Further, a May 2016 email from Strzok, obtained by Fox News earlier this year, said “we know foreign actors obtained access” to some Clinton emails, including at least one “secret” message “via compromises of the private email accounts” of Clinton staffers.

Rep. Louie Gohmert, R-Texas, asked Strzok in a House Oversight Committee hearing in July whether he was briefed about an anomaly on Clinton’s emails found by ICIG officials.

“You were given that information, and you did nothing with it,” Gohmert told Strzok in July.

Strzok said he remembered meeting with the ICIG officials, but did not remember the contents of the meeting and that every allegation was forwarded to experts who looked at it carefully.

“If there was a lead, I gave it to the team,” Strzok said as part of a heated back-and-forth between the two. Strzok was fired this month after controversy surrounding anti-Trump texts he sent to FBI lawyer Lisa Page, with whom he was having an affair.

Reached by phone Tuesday, Gohmert told Fox News on Tuesday that the emails were obtained by a foreign country’s intelligence, but he declined to name the country in question. He said there was no sign that Strzok and the FBI had taken any action when informed by the ICIG, and no indication that they even informed Clinton.

He told Fox News he was surprised that his questioning about it in the Strzok hearing in July didn’t generate more media attention, but noted that the press seized on a comment he made shortly afterward when he asked Strzok, “How many times did you look into your wife’s eyes and lie about Lisa Page?”

“It’s critically important,” he said, when asked about the significance of the server revelation. “There are countries that would pay a tremendous amount of money to know what Clinton was saying, doing and thinking through her emails, what she’s doing, who she’s going to meet, what she thought about meetings, not necessarily classified but critically important and those emails were compromised and people like Strzok, when they were briefed, knew this would devastate her chances of being elected and they weren't about to do anything to hurt those chances.”

Then-FBI Director James Comey concluded the FBI’s investigation into Clintons emails in July 2016, saying that while Clinton had been “extremely careless” in her handling of classified information, he would not recommend charges to the DOJ.