Image copyright EPA / AFP Image caption Less than two months remain before the election

US presidential candidate Hillary Clinton has apologised for calling half of Donald Trump's supporters "deplorable" people.

But the Democrat launched a furious attack on her Republican opponent and promised to keep fighting "bigotry and racist rhetoric".

Mr Trump had responded by saying the comment was "insulting" to "millions of amazing, hard working people".

Opinion polls suggest Mr Trump is gaining on Mrs Clinton.

The rivals are neck and neck in the key battleground states of Ohio and Florida.

Up in the air again: Analysis by Anthony Zurcher, BBC News

Image copyright Reuters Image caption Could this be Hillary Clinton's Mitt Romney moment?

Hillary Clinton's "basket of deplorables" comments have drawn immediate comparisons to Mitt Romney's 2012 line about 47% of Americans on government dole supporting Barack Obama and Mr Obama's 2008 characterisation of downtrodden Pennsylvanians as clinging to guns and religion.

Unlike those noted gaffes, however, it is not clear how Mrs Clinton's public remarks will directly damage her. She is certainly unlikely to peel off any of Donald Trump's supporters by calling some of them racists or homophobes, but they have stuck by their man through thick and thin. Mrs Clinton's own backers likely agree with her description.

The only question is how the sizable chunk of undecided voters view the controversy. They had started to move toward Mrs Clinton after the Democratic convention but are recently back up in the air or aligning with a third party. They may take exception to Mrs Clinton's calling fully half of all Trump supporters - millions of Americans - deplorable, which is why she has walked back this portion of her comments.

If the debate turns over how many of Mr Trump's backers are overtly racist or bigoted, however, that is political terrain the Democrat will gladly fight on.

What she said on Friday

Speaking at a fundraiser in New York, Mrs Clinton said: "To just be grossly generalistic, you can put half of Trump's supporters into what I call the 'basket of deplorables'. Unfortunately there are people like that. And he has lifted them up."

Media playback is unsupported on your device Media caption Hilary Clinton: "You could put half of Trump's supporters in what I call the basket of deplorables"

They were, she told the LGBT event, "racist, sexist, xenophobic, Islamophobic - you name it".

The rest of the Republican nominee's supporters, according to Mrs Clinton, were "just desperate for change".

How the Republicans reacted

In his tweeted response, Mr Trump said, "I think it will cost her at the polls!"

Image copyright @realDonaldTrump

Mr Trump's running mate, Mike Pence, said: "They are not a basket of anything. They are Americans & they deserve your respect."

Reince Priebus, head of the Republican National Committee, said Mrs Clinton had shown "her outright contempt for ordinary people".

Millions of Americans, he said, supported the Republican nominee because they were "sick of corrupt career politicians like Hillary Clinton".

Other Republicans mocked Mrs Clinton, sharing photos of the crowd in the Florida venue where Mr Trump spoke on Friday.

The hash tag #BasketOfDeplorables has been trending on social media as indignant Republicans attack Mrs Clinton.

"A candidate who writes off half the country as a #BasketOfDeplorables should be disqualified", was one comment on Twitter.

What Clinton says now

Apologising, Mrs Clinton said: "Last night I was 'grossly generalistic' and that's never a good idea. I regret saying 'half' - that was wrong."

"As I said," she added, "many of Trump's supporters are hard-working Americans who just don't feel like the economy or our political system are working for them."

But for most of the statement, she attacked her rival, accusing him of building "his campaign largely on prejudice and paranoia" and giving a national platform to "hateful views and voices, including by retweeting fringe bigots with a few dozen followers and spreading their message to 11 million people".

"David Duke and other white supremacists see him as a champion of their values," she said in the statement.

It was, she said, "really deplorable" that her Republican opponent was linked to people from the right-wing "alt-right movement".

Where this is going

Passions are high just over two weeks before the first election debate between Mrs Clinton and Mr Trump on 26 September.

After one of the most bitterly fought election campaigns in living memory, Americans go to the polls on 8 November to elect a successor to President Barack Obama.

The Democrat is standing down after two terms in office.