High circulating concentrations of the gut microbiota-derived metabolite trimethylamine N-oxide (TMAO) are significantly associated with the risk of obesity and type 2 diabetes (T2D). We aimed at evaluating the impact of glycemic control and bariatric surgery on circulating concentrations of TMAO and its microbiota-dependent intermediate, γ-butyrobetaine (γBB), in newly diagnosed T2D patients and morbidly obese subjects. An additional experiment was carried out in eight male C57BL/6J mice fed a Western-type diet for twelve weeks. The strategy for glycemic control in the T2D patients significantly improved the HbA1c concentrations without producing changes in the estimated glomerular filtration rate. However, the plasma TMAO and γBB concentrations were significantly increased following the glycemic control in T2D patients. Bariatric surgery was very effective in reducing weight in obese subjects. Nevertheless, the surgery reduced plasma γBB concentrations without affecting TMAO concentrations and the estimated glomerular filtration rate. Neither diet-induced obesity nor insulin resistance were associated with circulating TMAO and γBB concentrations in mice. Our findings do not support that glycemic control or bariatric surgery improve the circulating concentrations of TMAO in newly diagnosed T2D and morbidly obese patients. The contribution of antidiabetic drugs to gut microbiota composition could explain TMAO elevations in treated T2D subjects.