Bertrand Piccard, a 54-year-old Swiss psychiatrist and balloonist, landed Solar Impulse at 11.30pm (2230 GMT) under a full moon at Rabat Sale airport where he was welcomed by officials of the Moroccan Solar Energy Agency (MASEN).
Big marquees had been erected near the airport for the organizers of the flight, shown live on the site solarimpulse.com.
The plane was to stay in Rabat for five days before taking off for Ouarzazate in the south of Morocco for the launch by King Mohammed VI of construction of the largest-ever solar thermal plant.
As he got out of the aircraft, the pilot looked exhausted after the nearly 19-hour flight but was smiling. A special terminal had been set up by the Moroccan airport authorities with a large police presence.
Dozens of people, including flight organisers and Moroccan officials, gathered at the runway to witness the historic touchdown.
Piccard had taken off from Madrid's Barajas airport before dawn at 5.22am (0322 GMT) in the Solar Impulse, an aircraft as big as an Airbus A340 but as light as an average family car.
"For one hour I had the full moon on my right and I had the sunrise on my left and that was absolutely gorgeous," Piccard told AFP in an interview from the cockpit shortly after setting out.
"I had all the colours of the rainbow in the sky and also on the ground."
After more than 10 hours' flight, Piccard had climbed to more than 5,500 metres (18,000 feet).
Flying at some 45 kilometres (28 miles) per hour in the freezing, high altitude, he needed an oxygen mask to breathe.
An onboard video camera relayed images of the distant patchwork of fields and valleys stretched out below the aircraft, which has 12,000 solar cells in the wings turning four electrical motors.
To qualify as an intercontinental flight, Piccard had only to cross the Strait of Gibraltar -- 14 kilometres (nine miles) at its narrowest point -- from Europe to Africa.
The crossing is one of the most challenging points of the voyage because of the need of oxygen and temperatures that can dip as low as minus 29 degrees Celsius.
He entered Moroccan airspace without any hitches, Mustapha Bakkoury, the head of the North African country's solar energy agency, told AFP on the telephone.
The aircraft is not using a drop of fuel.
Each of the motors on the carbon-fibre craft charges 400-kilogramme (880-pound) lithium polymer batteries during the day, allowing the aircraft to carry on flying after dark.
In the bright Spanish sun, the batteries had been recharged to full capacity by the afternoon.
"The question is not to use solar power for normal airplanes," Piccard explained.
"The question is more to demonstrate that we can achieve incredible goals, almost impossible goals, with new technologies, without fuel, just with solar energy, and raise awareness that if we can do it in the air, of course everybody can do it on the ground."
Organizers say the voyage has been timed to coincide with the launch of construction of the largest-ever solar thermal plant in Morocco's southern Ouarzazate region.
Piccard, who made the world's first non-stop around-the-world balloon flight in 1999 together with Briton Brian Jones, took over the plane's controls from project co-founder Andre Borschberg.
Borschberg, a 59-year-old Swiss executive and pilot, flew a first leg from Payerne in Switzerland, landing in Madrid on May 25.
The voyage, 2,500 kilometres (1,550 miles) overall, is also intended as a rehearsal for Solar Impulse's round-the-world flight planned for 2014.
The aircraft made history in July 2010 as the first manned plane to fly around the clock on the sun's energy.
It holds the record for the longest flight by a manned solar-powered airplane after staying aloft for 26 hours, 10 minutes and 19 seconds above Switzerland, also setting a record for altitude by flying at 9,235 metres (30,298 feet).