Self-driving cars could be coming to the market in just a few years, if Nissan sticks to its just-announced plan.

The Japanese automaker said Tuesday it will begin selling autonomous cars by the year 2020.

"In 2007 I pledged that -- by 2010 -- Nissan (NSANF) would mass market a zero-emission vehicle. Today, the Nissan LEAF is the best-selling electric vehicle in history," Nissan chief executive Carlos Ghosn said in a statement. "Now I am committing to be ready to introduce a new ground-breaking technology, Autonomous Drive, by 2020, and we are on track to realize it."

Nissan said it is working with a number of universities, including the Massachusetts Institute of Technology, Carnegie Mellon and University of Tokyo to perfect the technology. The company is also building a special testing facility in Japan.

The automaker said it plans to have multiple self-driving models on the market in seven years and to have the technology available across its model range "within two vehicle generations." Cars are typically fully redesigned every five to six years, so that could be within 10 to 12 years.

Nissan is far from the only automaker working on technology for autonomous driving. General Motors (GM), Toyota and Germany's Audi, part of the Volkswagen (VLKAF) Group, are also working on self-driving cars. Technology company Google has long been working on the technology for years, as well.

A number of cars now on the market, for example the Mercedes-Benz S-class, have features that can take partial control of a car in certain circumstances to handle tasks such as active cruise control - which automatically keeps an even between cars in traffic, automatic braking, lane-keeping and parking. Nissan's Infiniti luxury division recently began selling the new Q50 which has some of these features as well.

As self-driving cars come closer to reality, a number of states have passed laws regarding testing of the vehicles on public roads. The National Highway Traffic Safety has also recently proposed rules for self-driving cars.