TOLEDO, Ohio — General Motors has agreed to loan $40 million to a newly formed company that wants to make electric pickups at a massive Ohio assembly plant GM shut down earlier this year.

The agreement between the two companies also would allow GM to buy back the plant up until next May, documents filed last week show. The amount available would be more than enough to cover the $20 million price tag for the plant.

Lordstown Motors Corp. announced a month ago that it had bought the the once-bustling factory near Youngstown that made the Chevrolet Cruze up until last March.

The new company wants to begin making electric trucks by late 2020, but it also said that it still needs more investors before manufacturing can begin.

It plans to hire 400 production workers next year.