Given the current market conditions and our focus on capital preservation, we continued to be very selective during the quarter, resisting transactions where deal structures were weak, leverage was too high and returns were not adequate to compensate for risk. During the year ended December 31, 2012, we invested $317.1 million across six new and several existing portfolio companies. This compares to investing $401.5 million across twelve new and several existing portfolio companies for the year ended December 31, 2011. Sales, repayments and other exits of investment principal totaled $314.8 million during the year ended December 31, 2012, versus $249.1 million during the year ended December 31, 2011. In conjunction with the early repayments of certain of our investments throughout 2012, we recognized $14.6 million in fees and prepayment penalties.
At December 31, 2012, our portfolio consisted of 47 portfolio companies and was invested 52% in senior secured loans, 18% in senior secured notes 16% in unsecured or subordinated debt securities, 13% in equity investments, and 1% in cash and cash equivalents. Our average portfolio company investment at amortized cost, excluding investments below $5.0 million, was approximately $26.9 million at December 31, 2012 versus $24.0 million at the end of the prior year.
The weighted average yields of the debt and income producing equity securities in our portfolio at their current cost basis were 12.2% at December 31, 2012 and 11.9% at December 31, 2011. The weighted average yields on our senior secured loans and other debt securities at their current cost basis were 11.4% and 13.5%, respectively, at December 31, 2012, versus 12.0% and 11.4% at December 31, 2011. Yields exclude common equity investments, preferred equity investments with no stated dividend rate, short-term investments and cash and cash equivalents. In certain of our portfolio companies, we hold equity positions ranging from minority interests to majority stakes, which we expect will contribute to our investment returns over time.