Doctors followed nearly 5,000 people as part of a trial to assess the health impact of the procedure.
The results, published in the Lancet Diabetes and Endocrinology journal, showed an 80% reduction in type 2 diabetes in those having surgery.
The UK NHS is considering offering the procedure to tens of thousands of people to prevent diabetes.
Obesity and type 2 diabetes are closely tied – the bigger someone is, the greater the risk of the condition.
The inability to control blood sugar levels can result in blindness, amputations and nerve damage.
Around a tenth of NHS budgets are spent on managing the condition.
The study followed 2,167 obese adults who had weight loss – known as bariatric – surgery.
They were compared to 2,167 fellow obese people who continued as they were.
There were 38 cases of diabetes after surgery compared with 177 in people left as they were – a reduction of nearly 80%.
Around 3% of morbidly obese people develop type 2 each year, however, surgery reduced the figure to around 0.5%, which is the background figure for the whole population.
Bariatric surgery, also known as weight loss surgery, is used as a last resort to treat people who are dangerously obese and carrying an excessive amount of body fat.
This type of surgery is available on the NHS only to treat people with potentially life-threatening obesity when other treatments have not worked.
Around 8,000 people a year currently receive the treatment.
The two most common types of weight loss surgery are:
The National Institute of Health and Care Excellence is considering a huge expansion of obesity surgery in the NHS in order to cut rates of type 2 diabetes.
Current guidance says surgery is a possible option for people with a BMI above 35 who have other health conditions.
But new draft guidelines argue much thinner people should be considered on a case by case basis and those with a BMI of 35 should automatically considered for surgery.
Diabetes UK says around 460,000 people will meet the criteria for an automatic assessment under the guidance.
But the total jumps nearer to 850,000 when those with a BMI of 30 are also considered, it says.
NICE anticipates figures in the tens of thousands. However, the surgery can cost between £3,000 and £15,000 and the move by NICE has raised concerns that the NHS will not be able to afford the treatment, even if there are savings in the longer term.
Source: National Institute of Health and Care Excellence.
Prof Martin Gullford, from King’s College London, told the BBC News website: “The key thing would be not only how effective is weight loss surgery but how safe is it in the long-term?
“And we need to know about the cost effectiveness of weight loss surgery and how that balances against the costs of diabetes, it does raise some complex issues.”
Simon O’Neill, the director of health intelligence at Diabetes UK, said: “This is interesting research that reinforces what we already know about weight loss being important for both preventing and managing type 2 diabetes.
“But it must be remembered that surgery carries risks and so bariatric surgery should only be considered if serious attempts to lose weight have been unsuccessful.
“Looking at the bigger picture, as a society we also need to focus more on stopping people becoming overweight, we need to look seriously at how we can make sure people are getting support to lose weight through access to the right services to encourage them to make healthy choices.”
Nearest tube – Elephant & Castle underground station (Northern and Bakerloo lines).
Nearest Railway Station – Elephant & Castle
Buses from Elephant and Castle – ask bus driver for Burgess Park. Bus numbers: 12, 171, 148, 176, 68, 484, 42, 40, 45