Motivated by the rationale that market inefficiency arises from a combination of less than fully rational demand and limits to arbitrage, this paper investigates the profitability of pairs trading across Mainland China and Hong Kong on highly liquid large‐cap and midcap stocks from January 1996 to July 2017. We have three main findings. First, we find that pairs trading constrained within each market generates no significant abnormal returns. However, if investors can trade across Mainland China and Hong Kong, pairs trading is profitable after adjusting for risk and transaction costs, where the annualized abnormal return is 9% over the full sample. Second, by using a rolling‐window regression, we find that the profitability of the strategy is time‐varying. The bootstrap simulations suggest that the decline in profitability of the strategy since 2012 is due to random chance rather than poor ability of identifying mispriced stocks. However, the vast majority of profitable periods reflect the strategy's ability to choose profitable stocks rather than random chance. Third, the profitability of the strategy is somewhat sensitive to market conditions, most notably, the strategy is more profitable during longer term market turbulence. Overall, our empirical findings are consistent with the Adaptive Market Hypothesis in that the integration of financial markets and market conditions determine the level of market efficiency.