WASHINGTON — The global diabetes rate has risen by nearly half over the past two decades, according to a new study, as obesity and the health problems it spawns have taken hold across the developing world.

The prevalence of diabetes has been rising in rich countries for several decades, largely driven by increases in the rate of obesity. More recently, poorer countries have begun to follow the trend, with major increases in countries like China, Mexico and India.

The study, published Monday in the British medical journal The Lancet, reported a 45 percent rise in the prevalence of diabetes worldwide from 1990 to 2013. Nearly all the rise was in Type 2, which is usually related to obesity and is the most common form of the disease.

A major shift is underway in the developing world, in which deaths from communicable diseases like malaria and tuberculosis have declined sharply, and chronic diseases like cancer and diabetes are on the rise. The pattern is linked to economic improvement and more people living longer, but it has left governments in developing countries scrambling to deal with new and often more expensive ways to treat illnesses.