This paper proposes a test for the null that, in a cointegrated panel, the long-run correlation between the regressors and the error term is di¤erent from zero. As is wellknown, in such case the OLS estimator is T -consistent, whereas it is p N T -consistent when there is no endogeneity. Other estimators can be employed, such as the FM-OLS, that are p N T -consistent irrespective of whether exogeneity is present or not. Using the di¤erence between the former and the latter estimator, we construct a test statistic which diverges at a rate p N under the null of endogeneity, whilst it is bounded under the alternative of exogeneity, and employ a randomisation approach to carry out the test. Monte Carlo evidence shows that the test has the correct size and good power.JEL codes: C12, C23.