PEOPLE with type two diabetes are more likely to have a shorter life expectancy, no matter their age or socioeconomic status, a new study has suggested.

Researchers analysed the health records of more than three million people and found the likely projected lifespan was lower by up to 5.5 years for some people with the condition compared to those without.

The study is the first of its kind to get a snapshot of type two diabetes and life expectancy in a national population.

Experts say that to improve life expectancy, prevention and management for type two diabetes should target all levels of society.

More than 291,000 people in Scotland -- one in 20 people -- have diabetes and nearly 90 per cent of those have type two of the condition.

It occurs when the pancreas does not produce enough insulin or the body's cells do not react to insulin, creating an inability to control blood sugar levels.

Researchers at Scottish universities compared the anonymised health records of more than 250,000 people with type two diabetes against 2.8 million people without the condition across Scotland.

They looked at the generated life expectancies for those aged 40 to 89 in 2012 to 2014.

The study considered the data alongside an indicator showing the level of deprivation in an area.

Researchers found life expectancy was lower for those in the type two diabetes group compared to those without across almost every five-year age band and at all levels of deprivation.

The only exception was men aged 80 and over in the most deprived areas.

The drop in life expectancy for those with the condition ranged from an estimated 5.5 year reduction for women aged 40 to 44 to a 0.1 year fall for men aged 85 to 89.

Sarah Wild, Professor of epidemiology at Edinburgh University, which led the research, said: "Our study suggests that to improve life expectancy, we should encourage prevention and management for type two diabetes across all of society.

"Our next steps will be to investigate the relationship between socioeconomic status and factors that could be affecting lifespan, such as heart disease.

"Although type two diabetes is a serious condition, healthy lifestyle choices can have a positive impact on management."

The study was published in the journal Diabetologia and was supported by the Scottish Diabetes Group.

There are five times as many people with type 2 diabetes than 50 years ago and it costs NHS Scotland an estimated £1 billion per year.

About four million Britons are living with Type 2 diabetes, but it is expected to hit more than five million by 2025.

The chronic condition is linked to obesity and is more likely to be diagnosed in older people.

Treatment involves controlling diet or medication, unlike type one diabetes which is typically treated with injections of insulin as the body produces none.

People with diabetes are also up to five times more likely to have cardiovascular disease, such as a stroke, than those without diabetes.

But lifestyle changes can help prevent it developing or getting worse.

A potential complication of the condition is diabetic retinopathy, which is the leading cause of preventable sight loss in working age adults.

Attending regular retinopathy screening is an essential part of diabetes care for people, aged 12 or over, who are living with the condition.

Earlier this year, Glasgow University announced a new test which can spot the early signs of diabetes, allowing doctors to prescribe treatments to stop the condition in its tracks.

Scientists discovered proteins that could help diagnose people at high risk of type two diabetes quicker.

Using new technology, the test could pick out those at risk before complications develop, or even stop it developing.