Former US Democratic presidential nominee Hillary Clinton believes that it “was a mistake” for her to not go after the then-FBI director, James Comey, during the 2016 election campaign.

Clinton, who eventually lost the election to her Republican rival, Donald Trump, made the remarks in a newly released excerpt from her upcoming book "What Happened." The excerpt was published by The Daily Beast on Wednesday.

Before the election, the now dismissed FBI director led a probe into Clinton’s use of a personal server to exchange government emails while she was secretary of state. He called her “extremely careless” for using a private email server as secretary of state from 2009 to 2013.

After the election, Comey began investigating President Trump’s alleged ties to Russia as well as a series of cyber attacks against Clinton’s campaign, which Democrats claimed were conducted by Russian hackers. Trump fired Comey.

In her book, which is set to be released on September 12, Clinton wrote that she was planning to “hit back hard” at Comey but her campaign advised her against it.

“My first instinct was that my campaign should hit back hard and explain to the public that Comey had badly overstepped his bounds — the same argument [Deputy Attorney General] Rod Rosenstein would make months after the election,” Clinton wrote.

“That might have blunted the political damage and made Comey think twice before breaking protocol again a few months later. My team raised concerns with that kind of confrontational approach,” she added.

“In the end, we decided it would be better to just let it go and try to move on. Looking back, that was a mistake,” she continued.

Clinton sent more than 30,000 potentially confidential emails while heading the US State Department. This is despite the fact that she had deleted thousands of the emails before turning over the server.

Before their ultimate face-off on November 8, Trump accused Clinton of violating federal laws for using a private email server and using her political links to get away with the crime.

Clinton had been leading Trump throughout the campaign in most of the polls except for the last week of the election when she lost ground to Trump.

Trump stunned the world on November 8 by defeating Clinton in the presidential election, sending the United States on a new and uncertain path.