The drug had already been approved for the same age population, 9 to 26, to prevent cervical, vulvar and vaginal cancer caused by certain types of HPV.
The agency said HPV is associated with approximately 90 percent of anal cancer. Karen Midthun, the director of the FDA's Center for Biologics Evaluation and Research, said that the use of Gardasil to prevent anal cancer is important because treatment for the disease is challenging.
Approval of the new indication had the backing of an FDA advisory panel, which last month said evidence supported the move.
Winning a wider market for Gardasil is key for the vaccine, once expected to be a blockbuster for Merck. Sales in Gardasil have weakened because the pool of users has shrunk as more are immunized and because of competition from GlaxoSmithKline PLC's Cervarix.