The National Association of Headteachers (NAHT) warned that schools would not co-operate with national targets "plucked out of the air" to meet political aims.
The move threatens to undermine a central plank of the Government's drive to raise standards in schools.
Ministers want 80 per cent of 11-year-olds to reach expected standards in English and 75 per cent to hit certain levels of maths by 2002.
Just over 60 per cent achieve the required level in national curriculum tests. David Blunkett, Secretary of State for Education, has promised to resign if the targets are not met.
But headteachers meeting in Eastbourne accused the Government of selecting arbitrary and unrealistic goals for local authorities.
David Hart, the NAHT general secretary, pledged to take court action if local authorities imposed targets on schools against their will.
He said: "It would be helpful if there was agreement but if agreement can't be reached the schools position must prevail. Just because the Government wants to reverse established practice in target setting it does not mean we have to roll over and say they have got it right."
Delegates unanimously passed motions attacking the Government for imposing targets and called for schools to be free to set their own goals.
Brian McNutt, head teacher of Eastway Primary School in The Wirral, warned that the emphasis on exam targets could make schools "educational sweat shops". He said: "It's a surreal world if children's best performance is met with league tables and public shame.
"To achieve the targets will schools be turned into exam factories, just simple factual machines to get us through the tests? If we are going to improve standards the Government needs to work with us, rather than impose national targets."
Mr Hart said: "I will jump for joy if we hit the targets, but if we can't it could be due to a whole range of factors. The Government is bravely treading in very difficult waters. Target setting is not an exact science."
The School Standards and Framework Bill, at present passing through the Commons, will allow local authorities to send in inspectors, appoint new governors or take control of budgets if schools are thought likely to miss targets for raising standards.
But Mr Hart said the powers should only be used in extreme circumstances and he threatened to press for a judicial review if local authorities used the legislation too readily.
Stephen Byers, the school standards minister, said the targets were "both reasonable and realistic". He said: "Surely it's not unreasonable to expect that in four years time four out of five 11-year-olds will have reached the level expected of them."
National executive member Mick Brookes won rapturous applause from delegates at the union's national conference when he told them: "This is a time to stand up and say no."
Mr Brookes, head teacher of Sherwood Junior School in Nottinghamshire, said: "There's a very clear message from the National Council to all our members: do not be bullied and pressurised into accepting unreasonable targets. We will come up with our own considered targets."
Delegates also attacked the growth of production-line education, insisting that schools were "places of wisdom, not factories of knowledge".
Chris McDonnell, head of Fulfen Primary School in Burntwood, Staffordshire, said targets did not reflect a school's full role. He said: "Schools are not factories. Knowledge is not a commodity to be sold. They are people places."
Graham Lane, education chairman of the Local Government Association, said: "If a school and a local education authority cannot agree on a target we will publish both targets and see which is right. The Government's targets for 2002 are very generalised. Some education authorities won't meet them, then we will have to work out what happens."
The headteachers demanded a change in the law to limit the powers of "school governors from hell". They asked for governors to be given compulsory training and appealed for legislation setting strict boundaries on their role.
The conference heard the case of a governor who had stood in a school car park timing when teachers came and went.Reuse content