Two FBI officials who would later be assigned to the special counsel’s investigation into Donald Trump’s presidential campaign described him with insults like “idiot” and “loathsome human” in a series of text messages last year, according to copies of the messages.

One of the officials said in an election night text that the prospect of a Trump victory was “terrifying.”

Peter Strzok, a veteran FBI counterintelligence agent, was removed over the summer from special counsel Robert Mueller’s team following the discovery of text messages exchanged with Lisa Page, an FBI lawyer who was also detailed this year to the group of agents and prosecutors investigating potential coordination between Russia and Mr Trump’s Republican campaign.

Hundreds of the messages, which surfaced in a Justice Department inspector general investigation of the FBI’s inquiry into Democrat Hillary Clinton’s use of a private email server, were being provided to congressional committees and were reviewed by The Associated Press on Tuesday.

The existence of the text messages, disclosed in news reports earlier this month, provided a line of attack for Mr Trump, who used the revelation to disparage FBI leadership as politically tainted.

Republicans have also seized on the exchange of texts between two officials who worked for Mr Mueller to suggest the team is biased against Mr Trump and its conclusions can’t be trusted.

A spokesman for Mr Mueller has said Mr Strzok was removed from the Mueller team as soon as the allegations were brought to the office’s attention, and that Ms Page had already concluded her detail by that time anyway and returned to the FBI. Mr Strzok has been reassigned within the FBI.

Working telephone numbers for Mr Strzok and Ms Page could not immediately be found.

Mr Strzok had been deeply involved in the Clinton inquiry and was in the room when she was interviewed by the FBI. He later helped investigate whether the Trump campaign worked with Russia to influence the outcome of the 2016 presidential election.

The texts seen by the AP began in the summer of 2015, soon after the FBI launched its email server investigation, and continued over the next year and a half as the presidential race was in full swing and as Mr Trump and Ms Clinton were looking to defeat their primary challengers and head towards the general election.

The messages — 375 were released on Tuesday evening — cover a broad range of political topics and include an exchange of news articles about the race, often alongside their own commentaries.

There are some derogatory comments about Democratic officials, including presidential candidate Bernie Sanders and former Attorney General Eric Holder, but some of the harshest comments are reserved for Mr Trump.

In a 4 March, 2016, back-and-forth provided to Congress, Ms Page refers to Mr Trump as a “loathsome human” and Mr Strzok responds, “Yet he may win.”

After Mr Strzok asks whether she thinks Mr Trump would be a worse president than fellow Republican Ted Cruz, Ms Page says, “Yes, I think so.”

The two then use words like “idiot” and “awful” to characterise Mr Trump, with Mr Strzok saying, “America will get what the voting public deserves.”

In another exchange, on 18 October, 2016, Mr Strzok writes to Ms Page and says: “I am riled up. Trump is an f***ing idiot, is unable to provide a coherent answer. I CAN’T PULL AWAY. WHAT THE F*** HAPPENED TO OUR COUNTRY??!?!”

Weeks later, on election day, as it seemed to become clearer that Mr Trump could defeat Ms Clinton, he says, “OMG THIS IS F***ING TERRIFYING: A victory by Mr Trump remains possible…”

Ms Page replies, “Yeah, that’s not good.”

In August 2016, Mr Strzok responded to a New York Times story that carried the headline of “Donald Trump is Making America Meaner” by saying, “I am worried about what Trump is encouraging in our behavior.”

But he also adds, “I’m worried about what happens if HRC is elected,” using the initials for Hillary Rodham Clinton.