TOKYO — Panasonic is pulling out of its partnership with Tesla to produce solar panels at a factory in New York state, the Japanese electronics maker said Wednesday.

Panasonic’s production at the factory in Buffalo will end by May, with an exit by September, it said in a statement. The decision is to streamline the company’s global solar energy operations, it said.

Panasonic will continue making batteries for Tesla’s electric vehicles in another factory in Nevada, it said.

Panasonic also quoted Tesla as saying that the move won’t affect Tesla’s solar business plans.

Panasonic will also continue selling solar panels under its brand in the U.S. through its own distribution channels, it said.

The two companies’ agreement to work on solar energy was announced in 2016.

Panasonic will offer severance packages to employees at the Buffalo plant. Tesla will hire as many as possible of those who wish to keep working there, according to Panasonic.

Tesla did not immediately respond to requests for comment.

“The decision to transition away from U.S. solar manufacturing in Buffalo aligns with our global solar strategy,” said Panasonic executive Shinichiro Nakajima.

Panasonic is a major manufacturer of home appliances, such as washing machines and refrigerators, but its operations include services and products for businesses.