In this paper we introduce a general framework for time-inconsistent optimal control problems. We characterize the closed-loop equilibrium strategy in both the integral and pointwise forms with the newly developed methodology. We recover and improve the results of some well-known models, including the classical optimal control, Bjork et al. ( 2017), He and Jiang (2020), and Yong (2012) models, and reveal some interesting aspects that appear for the first time in the literature. We illustrate the usefulness of the model and the results by a number of examples in dynamic portfolio selection, including mean-variance with state-dependent risk aversion, investment/consumption with non-exponential discounting, and utility-deviation-risk with coupled terminal state and expected terminal state.