In this paper we show that the disposition effect, a well documented pattern in investor behavior, can be a source of investor overconfidence. We identify a biased learning process through which the disposition effect leads to investor overconfidence. Our experimental results show that investors update beliefs about their own investment ability based on realized gains and losses rather than the overall performance of their portfolio. We formalize this learning process in a theoretical model in which the disposition effect leads to overconfidence, excessive trading, and lower investment performance.