City Comptroller John Liu said Friday that the move came after a thorough review of the fund's exposure to such investments.
Teachers union head Michael Mulgrew said selling the stock was "the right thing to do" after the school shootings in Newtown, Conn. Similar reviews of gun-industry holdings are under way at pension funds across the country since the massacre.
Liu says the $46.6 billion New York City Teachers' Retirement System is the largest pension fund to sell its gun industry holdings so far.
The fund had a total of $13.5 million invested in five gun makers. Those included Smith & Wesson Holding Corp. and Sturm, Ruger & Co.