BMW and Toyota announced a collaboration on engines and technology during an offsite press conference on the second press day of the Tokyo Motor Show. The mid- to long-term deal will cover, according to the companies, technologies that are—what else?—”environmentally friendly.”

Toyota president Akio Toyoda described the cooperation as a “great joy and a thrill,” while BMW CEO Norbert Reithofer acknowledged Toyota as being the “leading provider of environment-friendly series technology in the volume segment”—he really knows how to make a CEO blush—and boldly proclaimed the BMW Group to be “the most innovative and sustainable manufacturer of premium automobiles.”

One driver for the deal was BMW’s desire to leverage Toyota’s vast expertise in automotive batteries; “BMW showed interest in our battery technology,” said Takeshi Uchiyamada, executive VP at Toyota. As part of the agreement, the two companies will undertake basic research to accelerate the development of cheaper and more advanced lithium-ion battery cells. On the flipside, BMW will offer Toyota access to its portfolio of diesel engines. While Toyota offers its own 1.4-, 2.0-, and 2.2-liter diesel engines in the European Yaris, Auris, and Avensis models, BMW’s 2.0-liter four and its 1.6-liter offspring are more sophisticated and much better overall. The upshot: The contract will help generate additional economies of scale for BMW, and it will enable Toyota to drastically scale back its development of diesel engines in order to focus on hybrids and battery development.

BMW engines will appear in Toyota products starting in 2014, although they will be limited to only those that are “locally produced.” No Lexus is produced in Europe, so BMW needn’t worry about directly competitive products fitted with its own engines. In fact, the Lexus IS220d is such a slow seller that future Lexus models powered by any diesel engine aren’t likely for the foreseeable future. For the moment, BMW diesels probably won’t be fitted to U.S-market Toyota or Lexuses, but if our appetite for diesel-y torque and efficiency grows, it is a possibility.

We suspect BMW would be happy to expand the deal. It has a history of selling powerplants to many different automakers, and that covers not just supercars like the McLaren F1, but also rather pedestrian vehicles like the 1990s Opel Omega. An expanded Toyota deal makes sense for BMW, because it’s with a stable, global automaker that should be able to pay its bills. Many of BMW’s other recent engine deals have been with boutique automakers, and at least a few of them have been outright flops. Last year, for example, BMW announced that it would be supplying 1.6-liter turbo engines to Saab from 2012 on. Given Saab’s woes, that seems increasingly unlikely to happen. The same goes for the sale of 240,000 diesel units to the flailing startup Carbon Motors for its bespoke cop car; that agreement was announced with much fanfare in early 2010. Clearly, the Toyota deal stands a better chance of becoming, in the words of Reithofer, “another important step in the planned expansion of our sales activities for engines and powertrain systems.”