Summary In dealing with the problem of endogeneity in a time-varying parameter model, we develop the joint and two-step estimation procedures based on the control function approach. We show that a key to the success of the joint estimation procedure is in an appropriate state-space representation of the model. On the other hand, a correct treatment of the problem of generated regressors plays an important role in our two-step estimation procedure. Monte Carlo experiments confirm that the estimation procedures proposed in this paper work well in finite samples. Concerning our proposed endogeneity tests, the asymptotic distribution of both the likelihood ratio and Wald tests based on the second-step regression are reasonably well approximated by a χ2 distribution even in finite samples.