The San Francisco 49ers defeated the Detroit Lions 34-31 in the NFC title game to advance to Super Bowl LVIII.