Panasonic Corp. will end its tie-up with U.S. electric-car maker Tesla Inc. in producing solar cells after years of struggling to boost output, sources said Wednesday.

The electronics maker will continue its cooperation with Tesla on EV batteries, the sources said.

The two companies signed a contract in 2016 to jointly produce solar cells at Tesla's factory in the state of New York. But they have faced fierce competition from cheaper Chinese products.

Panasonic's EV battery business for Tesla achieved profitability in the October-December period after suffering a series of losses resulting from the huge initial investment.