Nissan may be going into space.

The automaker is teaming up with NASA to develop autonomous driving technology that could be used in vehicles on earth and on other planets.

The two outfits have announced a five-year mission to meld their efforts on driverless cars and extraterrestrial rovers to improve both for the future.

Nissan is excited about the potential of self-driving cars, which executives say could lead to improved safety, a pillar for future autos along with low emission technology.

NASA researchers will be working with Nissan's research unit in Silicon Valley, they said in a joint statement.

The maker of the Leaf electric car and Infiniti luxury models aims to introduce autonomous driving technology to consumers between 2016 and 2020. Ames developed the Mars rover software and robots onboard the International Space Station.

"The partnership brings together the best and brightest of NASA and Nissan and validates our investments in Silicon Valley," said Nissan Chief Executive Carlos Ghosn.

The safety technology in the works includes cars that know through sensors they are about to collide and will brake automatically, even if the driver doesn't do a thing. There are also cars that can park themselves.

At its most sophisticated, the technology could replace human drivers altogether, though there are many hurdles to that being put into practice on roads.

Automakers besides Nissan are working on the technology, including Japanese rival Toyota Motor Corp. and U.S. manufacturers General Motors Co. and Ford Motor Co.

And companies outside the industry are getting involved, such as Google Inc.

The driverless car was the topic of a keynote address by Ford Chief Executive Mark Fields at the International CES gadget show in Las Vegas earlier this week.

The Associated Press contributed to this report