Hillary Clinton has said Bernie Sanders’ attacks against her during the presidential campaign “caused lasting damage”.

According to excerpts of her new book, What Happened, that have surfaced online, Ms Clinton accused Mr Sanders of paving the way for Donald Trump's "Crooked Hillary" campaign.

Mr Sanders, an independent senator, had challenged Ms Clinton for the Democratic nomination for president. Ms Clinton wrote that her opponent “had to resort to innuendo and impugning my character” because they “agreed on so much".

“When I finally challenged Bernie during a debate to name a single time I changed a position or a vote because of a financial contribution, he couldn't come up with anything,” Ms Clinton said. “Nonetheless, his attacks caused lasting damage, making it harder to unify progressives in the general election and paving the way for Trump's 'Crooked Hillary' campaign.”

While Mr Sanders eventually campaigned for Ms Clinton following his defeat in the primaries, Ms Clinton did not hold back in her book, comparing the senator to the “deranged hitchhiker” in the 1998 Ben Stiller movie There’s Something About Mary.

“A deranged hitchhiker says he’s come up with a brilliant plan,” Ms Clinton wrote, describing a scene in the movie. “Instead of the famous ‘eight-minute abs’ exercise routine, he’s going to market ‘seven minute abs.’ It’s the same, just quicker. Then the driver, played by Ben Stiller, says, ‘Well, why not six-minute abs?’”

Bernie Sanders praises 'courageous' Jeremy Corbyn for 'revitalising democracy'

She added: “That’s what it was like in policy debates with Bernie. We would propose a bold infrastructure plan or an ambitious new apprenticeship program for young people, and then Bernie would announce basically the same thing, but bigger. On issue after issue, it was like he kept proposing four-minute abs, or even no-minute abs. Magic abs!”

Ms Clinton also wrote that some of Mr Sanders’ supporters, “the so-called Bernie Bros, took to harassing my supporters online".

Bernie Sanders campaigns with Hillary Clinton Show all 15 1 /15 Bernie Sanders campaigns with Hillary Clinton Bernie Sanders campaigns with Hillary Clinton Democratic presidential candidate Hillary Clinton, followed by Sen. Bernie Sanders, I-Vt. arrives for a rally in Portsmouth, N.H., Tuesday, July 12, 2016. Andrew Harnik/AP Bernie Sanders campaigns with Hillary Clinton A woman holds a sign at an event where Bernie Sanders will appear with Hillary Clinton at Portsmouth High School July 12, 2016 in Portsmouth, New Hampshire. Sanders and Clinton are expected to show unity within the party and a forwarding of their agendas. Darren McCollester/Getty Bernie Sanders campaigns with Hillary Clinton Cerys Coffey, 5, of North Hampton, Massachusetts, walks along a line of supporters waiting to get into a campaign event with Democratic U.S. presidential candidates Hillary Clinton and Senator Bernie Sanders in Portsmouth, New Hampshire, U.S., July 12, 2016. Mary Schwalm/Reuters Bernie Sanders campaigns with Hillary Clinton Democratic U.S. presidential candidate Hillary Clinton and Sen. Bernie Sanders stand together during a campaign rally where Sanders endorsed Clinton in Portsmouth, New Hampshire, U.S., July 12, 2016. Brian Snyder/Reuters Bernie Sanders campaigns with Hillary Clinton Democratic U.S. presidential candidate Hillary Clinton and Sen. Bernie Sanders greet supporters during a campaign rally where Sanders endorsed Clinton in Portsmouth, New Hampshire, U.S., July 12, 2016. Brian Snyder/Reuters Bernie Sanders campaigns with Hillary Clinton Democratic U.S. presidential candidate Hillary Clinton speaks as Senator Bernie Sanders looks on after he endorsed her during a campaign rally in Portsmouth, New Hampshire, U.S., July 12, 2016. Brian Snyder/Reuters Bernie Sanders campaigns with Hillary Clinton Democratic U.S. presidential candidate Hillary Clinton (R) looks on as Senator Bernie Sanders endorses her during a campaign rally in Portsmouth, New Hampshire, U.S., July 12, 2016. Brian Snyder/Reuters Bernie Sanders campaigns with Hillary Clinton Democratic U.S. presidential candidate Hillary Clinton looks on as Senator Bernie Sanders endorses her during a campaign rally in Portsmouth, New Hampshire, U.S., July 12, 2016. Brian Snyder/Reuters Bernie Sanders campaigns with Hillary Clinton Democratic presidential candidate Hillary Clinton, followed by Sen. Bernie Sanders, I-Vt., arrives for a rally in Portsmouth, N.H., Tuesday, July 12, 2016, where Sanders endorsed Clinton for president. Andrew Harnik/AP Bernie Sanders campaigns with Hillary Clinton Sen. Bernie Sanders, I-Vt. waves as he a Democratic presidential candidate Hillary Clinton arrive for a rally in Portsmouth, N.H., Tuesday, July 12, 2016. Andrew Harnik/AP Bernie Sanders campaigns with Hillary Clinton People hold signs outside an event where Bernie Sanders will appear with Hillary Clinton at Portsmouth High School July 12, 2016 in Portsmouth, New Hampshire. Sanders and Clinton are expected to show unity within the party and a forwarding of their agendas. Darren McCollester/Getty Bernie Sanders campaigns with Hillary Clinton Supporters for Democratic presidential candidates Hillary Clinton and Sen. Bernie Sanders, I-Vt. cheer before a rally in Portsmouth, N.H., Tuesday, July 12, 2016, prior to the arrival of Clinton and Sanders. Sanders is poised to offer his long-awaited endorsement of Clinton, hoping to transfer the energy of his supporters into the party's fight against Republican Donald Trump. Andrew Harnik/AP Bernie Sanders campaigns with Hillary Clinton Supporters of Democratic presidential candidate Hillary Clinton sing the national anthem in Portsmouth, N.H., Tuesday, July 12, 2016, prior to a rally with Democratic presidential candidates Hillary Clinton and Sen. Bernie Sanders, I-Vt. Sanders is poised to offer his long-awaited endorsement of Democratic rival Hillary Clinton, hoping to transfer the energy of his supporters into the party's fight against Republican Donald Trump. Andrew Harnik/AP Bernie Sanders campaigns with Hillary Clinton Supporters of Democratic presidential candidate Hillary Clinton sing the national anthem in Portsmouth, N.H., Tuesday, July 12, 2016, prior to a rally with Democratic presidential candidates Hillary Clinton and Sen. Bernie Sanders, I-Vt. Sanders is poised to offer his long-awaited endorsement of Democratic rival Hillary Clinton, hoping to transfer the energy of his supporters into the party's fight against Republican Donald Trump. Andrew Harnik/AP Bernie Sanders campaigns with Hillary Clinton A woman holds poster for Democratic presidential candidate Hillary Clinton during a rally in Portsmouth, N.H., Tuesday, July 12, 2016, where Sen. Bernie Sanders, I-Vt. endorsed her for president. Andrew Harnik/AP

“It got ugly and more than a little sexist,” she added.

Ms Clinton’s book, which describes her latest experience running for president, is scheduled to be released on 12 September. However, several supporters who obtained the book early have published excerpts on social media.

Ms Clinton also talks in her book about how she was urged – including by then-President Barack Obama – to not “hit back against Bernie’s attacks".