David Cameron has ordered ministers to carry out the government's biggest U-turn since the general election by abandoning plans to change the ownership of 258,000 hectares of state-owned woodland.

Caroline Spelman, the environment secretary, will announce on Friday that a consultation on the sale of forests will be ended after a furious backlash that united Tory supporters with environmentalists and the Socialist Workers party.

"The consultation is going to be terminated," a government source has said. A No 10 insider added: "It's a cock-up. We just did not think."

The prime minister, who told MPs that he was not happy with the government's handling of the issue, has ordered Spelman to:

• End the consultation on plans to dispose of about half of the 258,000 hectares of woodland in England run by the Forestry Commission by 2020.

• Establish an independent panel with environmentalists to reach consensus on reforms to improve access and biodiversity in forests.

• Drop clauses in the public bodies bill that would allow the government to sell off all of England's forests. Under current laws only 15% of forests can be sold.

One government source said: "We have heard, we have listened. The consultation will be canned. The consultation will be terminated. It is now a case of coming up with something everyone is happy with."

The U-turn represents a victory for an unlikely coalition of disparate groups launched in October. The grassroots website 38 Degrees started a petition which, by last night, had attracted more than 531,000 signatures. One poll suggested 84% of the country opposed the sale.

Cameron indicated at prime minister's questions that he was backing away from the sell-off when Ed Miliband asked him if he was happy with his "flagship policy on forestry", which could have raised £350m.

"The short answer to that is – no," Cameron said to laughter, and shouts from Labour MPs of "timber". But he denied that the government was embarking on a U-turn. "It is a consultation that was put forward. We've had a range of interesting responses to this consultation. What is important is that we should be making sure that, whatever happens, we increase access to our forests, we increase biodiversity and we don't make the mistake that was made under the last government where they sold forests with no access rights at all," he said.

The government has been under intense pressure since Spelman unveiled the plans last year and earmarked the Forestry Commission for substantial reform. She has faced intense criticism from Tory MPs who have been confronted by angry constituents who believe the government is showing a lack of sensitivity to a key part of the fabric of the nation.

Yesterday Miliband mocked Cameron over the plans. The Labour leader said: "Even he must appreciate the irony: the guy who made the tree the symbol of the Conservative party flogging them off round this country. He says they are consulting on this policy. They are actually consulting on how to flog off the forests, not whether to sell off the forests. Is the prime minister now saying that he might drop the policy completely?"

Cameron replied: "I would have thought the whole point about a consultation is that you put forward some proposals, you listen to the answer and then you make a decision. I know it is a totally alien concept but what is so complicated about that?"

Miliband said: "Everybody knows you have to drop this ludicrous policy. Let me give him the chance to do it. Nobody voted for this policy; 500,000 people have signed a petition against the policy. Why doesn't he, when he gets up at the dispatch box, say not say he is postponing the sale but say he is cancelling it?"

Cameron replied: "Once again, he read the question before he listened to the answer. I think the bandwagon has just hit a bit of a tree."

The Spelman announcement tomorrow will be the government's biggest U-turn since the election. Other U-turns include:

• Michael Gove's decision to backtrack on plans to abolish dedicated funding for school sport and his offer of consultations with Booktrust over the provision of free books to children.

• Dropping plans to publish the names of 3,277 civil servants who earn between £58,000 and £128,000 a year.

• Scrapping plans to to remove free milk for the under-fives.

The U-turn will raise questions about Spelman. Cameron, who has been joking about the environment secretary in front of colleagues, believes she has shown poor judgment in failing to appreciate the perils of confronting core middle England voters. "Spelman is finished," one senior Tory said yesterday.

But Tories also believe the U-turn highlights weaknesses in the No 10 operation. Senior MPs, who complain about a repeated failure to conduct "due diligence" on government plans before they are launched, hope the arrival of Andrew Cooper as the new director of strategy will avoid a repeat of such mistakes.

In under three months the sell-off had united organisations and individuals across the political divide who were concerned by loss of public access, the threat of development and damage to wildlife.

Groups as diverse as the Socialist Workers party, the Greens, the forestry industry, horse riders and mountaineers have all rejected the idea outright, mostly fearing that the safeguards for access and wildlife would not be adequate.

More than 100 celebrities, including the archbishop of Canterbury, Dame Judi Dench, Ken Livingstone, Richard E Grant and Dame Vivienne Westwood, signed a letter opposing the sale.

Government feet grew even colder last month after Dame Fiona Reynolds, director of the 3 million-strong National Trust, said the sale was a potential disaster for Britain and offered to step in if necessary to acquire important forests and hold them in perpetuity for the nation. Senior figures in the government are known to be nervous of the power of the trust's huge membership.

A Commons debate then showed growing unease among MPs, with seven coalition MPs rebelling and many others abstaining.