Image caption ISS and Atlantis crews take a call from the US President Barack Obama

US President Barack Obama joked with astronauts in a call to the International Space Station (ISS).

When he came on the line, the American leader said: "This is President Obama, who am I talking to?"

After the crew introduced themselves, he quipped: "Well, that's funny because I was just dialling out for pizza; I didn't expect to end up in space."

Mr Obama called the ISS to pay tribute to the crew of space shuttle Atlantis on its final visit to the station.

When Atlantis returns to Earth next Thursday, the ship will join the US space agency's (Nasa) other shuttles in retirement.

"There have been thousands who have poured their hearts and souls into America's space shuttle programme over the last three decades that are following this mission with special interest," the president observed. "To them and all the men and women of Nasa, I want to say thank you. You helped our country lead the space age and you continue to inspire us."

Mr Obama has set Nasa on a path to commercialising low-Earth orbit space transportation. He wants the next generation of American vehicles that taxi astronauts to and from the space station to be developed and operated by private companies.

The first of these ships could fly in the next three to four years. As an incentive, the Atlantis crew will be leaving on station a special flag flown by the maiden shuttle mission back in 1981. The first commercial crew to arrive at the ISS will be able to claim it as a prize in what Mr Obama described as a "capture the flag moment for commercial spaceflight".

Media playback is unsupported on your device Media caption Obama: "I was just dialling out for pizza"

"We sure hope to see some of our commercial partners climbing onboard really soon," said Atlantis shuttle commander Chris Ferguson. "I know there is a lot of competition out there, a lot of people are fervently working towards this goal to be the first to send a commercial astronaut into orbit; and we look forward to seeing them here soon."

Within minutes of the Obama call to the ISS, one of the leading companies bidding to provide commercial crew transportation, SpaceX of California, had posted on its Twitter stream: "SpaceX commencing flag capturing sequence…"

The Atlantis crew are in the midst of a very busy few days at the ISS. They brought up more than 3.5 tonnes of supplies, including over a tonne of food. All of it has to be transferred to permanent storage positions on the station, and then 2.5 tonnes of rubbish must be put inside the shuttle for the return to Earth.

Nasa has extended the mission by one day. Atlantis is due to land at the Kennedy Space Center in Florida early on 21 July local time.

"It's going to be sad to retire the shuttle," commander Ferguson said in an earlier call with the American media. "That said, it's had a very long and storied career. It's done tremendous things.

"If it weren't for the space shuttle, the station wouldn't be here and it certainly wouldn't be as large as it is." he added.

Image caption The Southern Lights seen from the ISS. In the foreground (left to right) are a station solar wing, a robotic boom and the docked Atlantis

Jonathan.Amos-INTERNET@bbc.co.uk