Pairs trading is a trading strategy which is used very frequently in the financial industry. An investment opportunity arises when the spread between two assets, which historically have exhibited autoregressive behavior, deviates from its recent history. In this case, the investor takes a long position in the asset which is expected to outperform going forward and finances this by taking a short position in the other one. If the spread converges, the investor can close both positions to generate a profit. We model the spread between two assets as an Ornstein-Uhlenbeck process and assume a constant opportunity cost. We then study the optimal liquidation strategy for an investor who wants to optimize profit in excess of the opportunity cost. Including this cost is important from an applied perspective, as the performance of any investment is always evaluated relative to the performance of the opportunity set.