Ford Motor Co. on Thursday swung to a surprise second-quarter profit after seven quarters of losses on cost-cutting and a turnaround in its core automotive operations.

Ford, which is in the midst of restructuring plan that includes closing 16 plants and cutting up to 45,000 jobs, posted a net profit of $750 million, or 31 cents per share, compared with a loss of $317 million, or 17 cents, a year earlier.

Ford's profit from continuing operations, excluding one-time items, was 13 cents per share. That blew past the average Wall Street forecast of a loss of 37 cents per share as tracked by Reuters Estimates.