BMW and Toyota have finalized their partnership on sports cars, fuel-cell tech and more, signing a binging agreement that will also see the German and Japanese marques collaborate on new lithium-air batteries. The deal, which builds on the two car company’s previous “memorandum of understanding” back in June 2012, focuses on four key areas for the future, with green motoring and lightweight, fun performance cars both on the agenda before 2020.

On the green side, BMW and Toyota plan to continue their joint work on fuel cell systems. They will share their existing research, and then collaborate on a “fundamental fuel-cell vehicle system” – consisting of fuel-cell stack, system, hydrogen storage tank, battery, and motor(s) – as well as the infrastructure to fuel it, with a mind to producing a working, practical setup by 2020.

Beyond that, however, will come lithium-air batteries, jointly researched as the eventual replacement for lithium-ion power packs as used in most recent all-electric or hybrid cars. That will take a little longer than the fuel-cell technology, but the target is a battery with far greater energy density than current-gen technology, improving range and reducing bulk and weight.

Slimming cars is, indeed, another of BMW and Toyota’s goals, not to mention applicable both to performance models and to green vehicles. Reinforced composites, more traditionally used in racing cars, will play a greater role in mainstream models, it’s suggested, including the fourth strand of the two companies’ collaboration: a new sports car.

A joint platform for a mid-sized car will be created, with a goal to complete that by the end of this year. The system – which will presumably be used as the underlying basis for two differently designed, branded, and positioned vehicles – will combine the best of Toyota’s EV, fuel-cell, and hybrid technology as well as BMW’s strengths in driving experience and dynamics.

It’s unclear when production models based on the platform might appear, though both firms have been flirting with squeezing performance out of what would normally be considered green technology. Toyota revealed the sleek NS4 hybrid concept last year, as well as demonstrating the speeds that could be squeezed out of electric vehicles with its Le Mans car, while BMW’s i8 Spyder is resolutely a sports machine, despite running on electricity.

Meanwhile, there are indications that this won’t be the end of Toyota and BMW’s work together. Comments from Dr. Herbert Diess, a member of BMW’s board, at a press conference in Japan to announce the binding agreement suggested it is the first in “a shared vision” that is necessary to cater for all types of mobility requirement in the future.