Doctors from 50 GP practices in Hertfordshire have agreed to prevent those who smoke or have a high BMI from receiving hip or knee replacement surgery before they have attempted to stop smoking or lose weight.
Patients with a BMI above 30 and patients who smoke will be referred to weight management or smoking cessation treatments before being allowed the routine operations, in an attempt to get them to "heal themselves" and cut costs.
Plans are in process to extend the scheme to all routine surgery over the next few months.
The British Medical Association said every patient should be considered on an individual basis and it "would not support a blanket ban".
Those who refuse to give up smoking or fail to lose weight will not be prevented from having surgery in the long term but will first be encouraged to reform their lifestyle in an attempt to improve their condition.
Tony Kostick, chair of the north east Hertfordshire clinical commissioning group, told The Independent: "This is about GPs accepting a greater gatekeeping role. The NHS spends a fortune on treatments of limited clinical value. We trawled through the evidence and found outcomes were poorer for smokers and the obese. They are in hospital longer, have more complications, more post-operative infections and do less well."
He added: "We are trying to get GPs to understand that if we spend money on one patient, that money is not available to spend on the next. If an obese patient loses weight they may not need surgery. We are not saying no to anybody but there are things you can do for yourself which will make you healthier before you have treatment. That is rationing but on the basis of the best clinical practice."
Mike Ingram, chair of the Red House GP Consortium in Radlett, Hertfordshire, which covers 18,900 patients, said: "This is discrimination against patients who may need care. People are complex - we do not support a blanket restriction solely on the grounds of smoking or obesity. That is unethical. Extending the restriction to all routine surgery is extremely destructive and unreasonable."