The extraordinary row erupted when Ms Abbott, 58, published the remark on Twitter as part of a debate on race relations following the conviction of two of black teenager Stephen Lawrence’s killers.

The MP for Hackney North and Stoke Newington told another Twitter user, freelance journalist Bim Adewunmi: “I understand the cultural point you are making.

“But you are playing into a ‘divide and rule’ agenda.”

She went on: “Ethnic communities that show more public solidarity & unity than black people do much better.”

Ms Abbott later claimed that the Twitter rule restricting comments, known as “Tweets”, to 140 characters had prevented her getting her meaning across.

“Tweet taken out of context. Refers to nature of 19th Century European colonialism. Bit much to get into 140 characters,” she wrote.

Later, when Ms Abbott was telephoned by Mr Miliband in the middle of a television interview to explain her remarks, she gestured to the camera crew to leave.

Shortly afterwards, she issued a statement saying: “I understand people have interpreted my comments as making generalisations about white people. I do not believe in doing that. I apologise for any offence caused.”

A Labour Party spokesman said: “We disagree with Diane’s tweet.

“It’s wrong to make sweeping generalisations about any race, creed or culture.

“The Labour Party has always campaigned against such behaviour and so has Diane Abbott.”

However, Labour officials insisted she would not be sacked and praised her record in campaigning against racism. A source close to Mr Miliband said: “It was made clear to Diane Abbott that she could not stay in her shadow post unless she apologised. She does not believe what she said in the Tweet.

“As every journalist should know, Twitter is a treacherous medium.”

The remarks were met by a storm of criticism across the political spectrum on the website.

Labour councillor Joanne Harding wrote: “Very disappointed with her remarks.” Another Twitter user added: “Remember that last election? That was the last time I’ll ever vote for you.

“Never again. What planet are you on?”

The episode was last night being seen as a huge embarrassment for Mr Miliband, who was criticised by his former adviser Lord Glasman earlier this week for weak and dithering leadership.

Many Labour MPs were surprised when Mr Miliband gave Ms Abbott her post, given her track record on the party’s hard Left and previous outspoken comments on race.

She provoked anger when campaigning for the Labour leadership in 2010 by defending her decision to send her son to a fee-paying school by saying: “West Indian mums will go to the wall for their children.

“I have said everything I am going to say about where I send my son to school.”