We provide a proof of the necessary and sufficient condition on the profile of the temperature, chemical potential, and angular velocity for a charged perfect fluid in dynamic equilibrium to be in thermodynamic equilibrium not only in fixed but also in dynamical electromagnetic and gravitational fields. In passing, we also present the corresponding expression for the first law of thermodynamics for such a charged star.