Hypothalamic inflammation reduces appetite and body weight during inflammatory diseases, while promoting weight gain when induced by high-fat diet (HFD). How hypothalamic inflammation can induce opposite energy balance outcomes remains unclear. We found that prostaglandin E2 (PGE2), a key hypothalamic inflammatory mediator of sickness, also mediates diet-induced obesity (DIO) by activating appetite-promoting melanin-concentrating hormone (MCH) neurons in the hypothalamus in rats and mice. The effect of PGE2 on MCH neurons is excitatory at low concentrations while inhibitory at high concentrations, indicating that these neurons can bidirectionally respond to varying levels of inflammation. During prolonged HFD, endogenous PGE2 depolarizes MCH neurons through an EP2 receptor-mediated inhibition of the electrogenic Na+/K+-ATPase. Disrupting this mechanism by genetic deletion of EP2 receptors on MCH neurons is protective against DIO and liver steatosis in male and female mice. Thus, an inflammatory mediator can directly stimulate appetite-promoting neurons to exacerbate DIO and fatty liver.