Just before he phoned Julia Gillard to congratulate her on ascending to the prime ministership, Barack Obama called the man she'd just assassinated to take it.

Like most of Washington, Obama was not only surprised but shocked at the news, the President told the freshly dumped prime minister, according to US officials familiar with the call.

Obama said he appreciated everything they had done together and he hoped they could continue their friendship and their partnership in working on international challenges.

Rudd replied that he had decided to stay in Parliament, and fully intended to remain active on the international issues he had been involved in. It was possible he would be in a future Gillard cabinet.

Obama evidently formed the impression that Rudd might be interested in some sort of international job, and he hastened to offer support. He said he would be favourably disposed towards working with Rudd in any future areas of international interest.