TOKYO— Subaru Corp. FUJHY 1.21% is picking up a hefty tab to recall over 400,000 vehicles globally to repair a faulty engine part that could cause stalling.

The recall affects its popular Forester sport-utility vehicle and Impreza compact, as well as the BRZ sports car. It also affects the Subaru-made Toyota 86 sports car, which was sold in the U.S. as the Scion FR-S during the period covered by the recall. All the cars were made in 2012 and 2013.

Last week, Subaru cut expectations for April-September, the first half of the Japanese financial year. The company now expects an operating profit of ¥61 billion ($540 million), a reduction of ¥49 billion from its prior projection, mostly to cover recall-related costs. The company said it would outline the impact of the recall for the full year when it announces second-quarter earnings Monday.

Subaru said valve springs in the recalled cars could fracture and cause the engine to stall, risking an accident. These springs keep engine valves closed when the fuel is being combusted. Failure can cause severe engine damage.

The repairs are likely to be costly. Subaru believes the work will take more than 12 hours.

Toyota said its vehicles account for around 80,000 of the total. In the U.S., Toyota is recalling around 25,000 Scion FR-S models manufactured between March 2012 and July 2013. The company said it would contact affected U.S. owners by mail starting in December.

The recalled Subaru vehicles were made between January 2012 and September 2013. Subaru said 101,000 of the recalled vehicles were sold in Japan. A company spokesman declined to say how many were being recalled in the U.S. Subaru sold nearly 270,000 of the three affected models in the U.S. during the period covered by the recall.

Last week’s earnings disclosure, made after markets had closed in Japan, caught investors by surprise. The next day Subaru’s share price dropped nearly 7%.

On the day of the announcement, Tokyo-based auto analyst Takaki Nakanishi criticized Subaru for the lack of detail, saying in a client note that it “raises questions about the quality of its investor relations.” At the time he wrote that he anticipated a recall of between 1 million and 2 million vehicles, a number echoed in some Japanese press reports.

A Subaru spokesman said it had been unable to provide more detail in its initial disclosure because it hadn’t yet made the required filings with regulators.

Write to Sean McLain at sean.mclain@wsj.com