Abstract: I develop a panel data estimator, the Generalized Three-Step Panel Data (G3SPD) estimator, allowing for a consistent (or at least less biased) estimation of models with endogenous regressors and the inclusion of dimension-invariant variables. Standard estimators fail to account for one or both problems. Simulated experiments show it substantially outperforms classical estimation techniques in terms of bias. I also analyze the behavior of the standard errors and how they can affect inference. I show that the standard errors obtained by standard methods are downward biased and propose an adjusted variance-covariance matrix for the 3rd Step of the G3SPD estimator. Using Monte Carlo simulations I find that the adjusted standard errors outperforms popular panel data estimators across sample sizes and degrees of heterogeneity of the unobservable effects, irrespective of assuming fixed- or random-effects designs. Finally, I apply the G3SPD estimator to three classical panel data applications (namely, a gravity model of bilateral trade, economics of crime, and analysis of wage determinants and returns to schooling). I find that alternative estimators such as error-components or Hausman-Taylor-type estimators may be highly biased both in terms of coe¢ cients estimation and fitting the sample. Additional Monte Carlo experiments applied to the estimation of the wage equation show that the G3SPD estimator is able to control the bias generated by omitted variables that are correlated with the included regressors (e.g. ability).