Apple Inc. has shut down some elements of its effort to build an electric self-driving car (Titan) and laid off several dozen employees, according to a person familiar with the matter.

The changes to Apple’s secretive initiative, code-named Project Titan, were implemented by Bob Mansfield, a veteran Apple executive who took over the project in July, the person said Friday. Project Titan’s overall head count remains essentially the same, the person said.

Apple has never publicly acknowledged that it is working on a car, but people familiar with the matter have previously said the effort includes hundreds of employees including software and automotive experts, as well as autonomous-driving technology engineers.

The effort has hit stumbling blocks, however. Earlier this year, the project’s leader, Steve Zadesky, left the company, citing personal reasons. Mr. Mansfield succeeded Mr. Zadesky.

Details on which Project Titan efforts were closed weren’t available. Bloomberg reported in July that Apple had shifted to prioritize development of an autonomous-driving system. News of the layoffs was first reported by the New York Times.

Traditional auto makers such as General Motors Inc., Ford Motor Co., and BMW AG are all working toward driverless cars. Ford said in August that it plans to release within the next five years a fully autonomous vehicle—one without a steering wheel or pedals. BMW said in July that it was teaming with Intel Corp. and Mobileye NV to have a self-driving car in production by 2021.

Apple’s steps toward building a car sent fears through the automotive industry that the iPhone maker might one day outshine them like it did cellphone makers. Tesla Chief Executive Officer Elon Musk complained to Bloomberg Businessweek in early 2015 that Apple was trying to hire away his automotive employees. Battery maker A123 Systems LLC sued Apple in early 2015 alleging it poached high-level battery engineers and chemists to work on Apple’s car-battery division in violation of agreements not to work for competitors. Apple and A123 later settled the case under terms that weren’t disclosed.