DETROIT -- Mazda is recalling more than 262,000 SUVs and cars in the U.S. to fix a software problem that could cause the engines to stall unexpectedly.

The recall covers certain Mazda6 midsize sedans and CX-5 SUVs from the 2018 and 2019 model years. Also included are Mazda3 small cars from 2019.

Mazda traced the problem to a software error in the computer that controls the valves as part of the vehicles' fuel-saving cylinder deactivation technology.

The company says in government documents posted Wednesday that drivers won't get any warning before the engine stalls.

Mazda says no crashes or injuries have been reported because of the problem.

Dealers will reprogram the software at no cost to owners. The recall is expected to start before Aug. 26.