This paper proposes a unified framework for accommodating both time and cross-sectional dependence in modelling technical efficiency in stochastic frontier models by combining the exogenously driven factor-based approach and an endogenous threshold efficiency regime selection mechanism. This approach is able to deal with both weak and strong cross-sectional dependence in a flexible manner. Using a dataset of 26 OECD countries over 1970-2010, we provide satisfactory estimation results for the production technology parameters and the associated efficiency ranking of individual countries. We find a positive spillover effect on efficiency, supporting the hypothesis that knowledge spillover is more likely to be induced by technological proximity. Furthermore, our approach enables us to identify efficiency clubs endogenously.