General Motors Co. lowered its full-year profit outlook, saying the 40-day strike at its U.S. factories wiped out nearly all its free cash flow for the year and will cost the Detroit auto maker close to $3 billion in lost earnings.

The move came even as the car company posted third-quarter results that easily surpassed analysts’ forecasts. Shares were up 4.9% at midday, a sign that investors are looking past the strike to the potential for strong earnings in 2020 underpinned by a refreshed line of pickup trucks, GM’s biggest...