Two months after buying about 10 percent of electric car startup Tesla Motors, Daimler is selling about 40 percent of that stake to an Abu Dhabi-based investment firm that is looking at developing a joint venture with the German automaker.

The deal between Daimler and Aabar Investments – owned by Abu Dhabi's government-controlled oil revenue investment firm International Petroleum Investment Company – was announced Monday.

But Daimler said that the deal with Aabar was part of its original plan when it bought about 10 percent of San Carlos, Calif.-based Tesla in May for a "double-digit million solar sum," according to Tesla CEO Elon Musk (see Daimler Takes 10% Stake in Tesla, Helps With Model S Launch).

That investment was seen as a boon to Tesla, given that it gave it an established automaker as a partner at a time when it was struggling to raise cash to expand (see Tesla Puts Musk at Helm, Expects Layoffs and Model S Delay and Musk: Tesla Hit by Market 'Freefall').

Daimler had already said it would turn to Tesla to help design battery packs and chargers for the first 1,000 electric versions of Daimler's Smart cars, as well as collaborate on future battery system and electric drive train work. Daimler also intends to build lithium-ion batteries for Mercedes vehicles at a plant being built in a joint venture with Evonik Industries (see Green Car Congress).

Monday's deal "allows Daimler and Aabar to leverage their shared interest in the development of low-CO2 drive systems," Daimler said in a news release.

The two said in March that they would work on joint strategic projects, "involving electric vehicles for example," when Aabar acquired 9.1 percent of Daimler, making it Daimler's largest single shareholder.

Specific details of what the two companies were planning in a joint venture weren't provided in Monday's announcement. But the news does fit in with the push into green technologies being made by Abu Dhabi, the emirate that houses the capital of the oil-rich United Arab Emirates.

Abu Dhabi's government-funded Masdar initiative has invested in a number of renewable energy projects and plans to build Masdar City, a proposed zero-emissions technology park (see Abu Dhabi Picks Suntech, First Solar for 10MW Solar Farm in Masdar City).

Tesla, for its part, recently won $365 million in federal loans to build a plant for its Model S, an all-electric sedan to sell for about $57,400 before federal tax credits of about $7,500. It would be Tesla's second model after the high-end Roadster, which sells for $109,000.

Tesla also received a $100 million federal loan from the Department of Energy to build an electric powertrain factory (see Green Light post).