David Cameron and Ed Miliband battled to ward off a growing risk that Lady Thatcher's death will polarise, and even damage, the nation by both paying generous tribute on Wednesday to her belief in political ideas and her understanding that the British economy of the 1970s needed to change.

In a deft and hazardous speech at the start of an extraordinary seven hours of often gushing praise and affectionate anecdote, Miliband managed to show his respect for her leadership, including over the Falklands, climate change and the Soviet Union, and yet frankly set out his manifold disagreements over policy and values, pointing out that many communities were left feeling angry and abandoned by her premiership.

Cameron, faced by a section on his own backbenches still hankering after her conviction politics, lauded the way she rejected the pessimism that he said was gripping the country in the 70s. "She had rescued the country from postwar decline," he said.

But he was carefully bipartisan, not solely blaming the Wilson and Callaghan governments for this defeatism, but instead asserting: "Successive governments had failed to deal with what was beginning to be called the British disease: appalling industrial relations, poor productivity and persistently high inflation.

"They say that cometh the hour, cometh the man. Well, in 1979 came the hour, and came the lady. She made the political weather. She made history. And let this be her epitaph: she made our country great again."

Barely 100 out of the 256 Labour MPs attended the day of praise, and some, notably Glenda Jackson, broke with the tone set by Miliband accusing Thatcherism of wreaking over a decade "the most heinous, social, economic and spiritual damage upon this country, upon my constituency and my constituents".

Thatcherism, she said, transformed into virtues "the vices of greed, selfishness, no care for the weaker, sharp elbows, sharp knees". She added: "The first prime minister of female gender, OK. But a woman? Not on my terms." Her remarks drew Tory protests and demands that the Speaker rule her remarks out of order.

Many Labour MPs remain furious that her death is being turned into a near state military funeral when other prime ministers, apart from Winston Churchill, were not afforded such pomp and ceremony. Labour figures that stayed away from parliament included Lord Kinnock, Lord Hattersley and Gordon Brown. It was notable that younger Labour MPs with northern constituencies absented themselves.

It also emerged that staging a day of tributes before the funeral and requiring an expensive recall of parliament was the idea of the prime minister and involved him in a lengthy wrangle with the Speaker's Office. John Bercow felt there was no need to recall parliament, and was taken aback by the request. His office thought the tributes could be paid next Monday in line with precedent for previous deaths of party leaders.

At one point, Cameron had to enlist the support of Miliband to overcome the opposition, and Labour sources said they felt faced with a fait accompli and did not want to risk being seen as failing to show Thatcher due respect. In a measure of the significance of the occasion for Cameron, after speaking in the Commons he went to the bar of the Lords to listen to some of the 5½ hours of speeches from a string of senior civil servants and former Conservative cabinet ministers, including Lord Waldegrave, Lord Forsyth and Lord Lamont.

In a further sign of the tensions over the extent to which a party political death may be recast as a state occasion, diplomats were left enraged and confused after receiving instructions that they must wear mourning clothes for Thatcher's funeral, even though it is not a state occasion.

A memo sent to embassies and hundreds of Whitehall staff told men to wear black ties and women to wear dark clothes next Wednesday – instructions usually reserved for the death of a head of state.

The Foreign Office confirmed the instructions had been issued on Tuesday night but said they were a mistake, adding that they would be withdrawn by Wednesday night.

Sources said the Foreign Office received complaints "from the highest level" of the civil service.

The memo read "Wednesday 17th will be a day of mourning. All staff are to wear mourning dress... Men are to wear dark suits and a black tie. Women should wear dark colours," the memo added.

In the Commons, Cameron had opened the day of praise saying: "Her political story was one of a perpetual battle, in the country, in this place and sometimes even in her own cabinet.

"She believed to the core of her being that Britain stood for something in the world: for democracy, for the rule of law, for right over might. She loathed communism and believed in the invincible power of the human spirit to resist and ultimately defeat tyranny. She never forgot that Warsaw, Prague and Budapest were great European cities, capitals of free nations temporarily trapped behind the iron curtain>

"She certainly did not shy from the fight and that led to arguments, to conflict and, yes, even to division, but what is remarkable, looking back now, is how many of those arguments are no longer arguments at all. No one wants to return to strikes without a ballot. No one believes that large industrial companies should be owned by the state. The nuclear deterrent, Nato and the special relationship are widely accepted as the cornerstones of our security and defence policies.

"So many of the principles that Lady Thatcher fought for are now part of the accepted political landscape of our country," he said.

Miliband drew praise from Tory MPs and rightwing commentators for a speech that navigated the rapids of describing a figure of such notoriety on the left so soon after death.

He admitted he came of age at a time when people defined their politics by being for or against what she was doing.

He praised her saying "she was right to understand the sense of aspiration felt by people across the country, and she was right to recognise that our economy needed to change. She said in 1982: 'How absurd it will seem in a few years' time that the state ran Pickfords removals and the Gleneagles hotel.' She was right.

"In foreign policy, she was right to defend the Falklands and bravely reach out to new leadership in the Soviet Union, and something often forgotten is that she was the first political leader in any major country to warn of the dangers of climate change, long before anyone thought of hugging a husky."But he added: "It would be dishonest and not in keeping with the principles that Margaret Thatcher stood for not to be open with the House, even on this day, about the strong opinions and deep divisions there were, and are, over what she did.

"In mining areas, such as the one I represent, communities felt angry and abandoned. Gay and lesbian people felt stigmatised by measures such as section 28, which today's Conservative party has rightly repudiated."

In one of the most wholehearted public tributes to Lady Thatcher from a non-political figure, the former England football captain David Beckham said : "It's a sad moment for the country, she was a strong and passionate lady.

"Whatever you think about her on the political side she was a lady that was looked on around the world as an amazing figurehead for our country for many years.

"My thoughts and the whole country's thoughts go to the family. They are the ones in pain at the moment. She was a very strong lady."