Ford Motor Co. posted flat second-quarter operating income and a disappointing earnings outlook, but stood by a forecast for improved profitability this year as it begins to reverse steep losses overseas.

The company’s shares fell in after-hours trading as its quarterly results and full-year earnings forecast fell short of analysts’ expectations.

Ford...