We follow recent developments of panel data studies and allow for the existence of both observed and unobserved common factors where their individual responses are allowed to be heterogeneous. We then develop a generalized Hausman-Taylor estimation methodology, and apply our proposed estimation technique to an analysis of the gravity equation of bilateral trade flows among 15 European countries over 1960-2001. Empirical results demonstrate that our proposed approach provides more sensible results than the conventional approach based on fixed time dummies. These findings may highlight the importance of allowing for a certain degree of cross-section dependence through unobserved heterogeneous time-specific effects; the resulting estimates would otherwise be severely biased.