The former CIA director, who resigned last month after having an extramarital affair with his biographer, declined in order to protect his personal life. "My wife would divorce me," he said. "And I love my wife."
Mr Ailes, a key Republican powerbroker who worked for Richard Nixon, told Mr Petraeus that he should reject the job of CIA director – from which he resigned last month – and campaign for the White House.
Mr Ailes passed his message to Mr Petraeus through an emissary sent to interview him in Kabul 18 months ago for Fox News, Mr Murdoch's American news channel, which is beloved by US conservatives.
"I've got something to say to you directly from Roger Ailes," Kathleen McFarland, a national security analyst for the channel, told Mr Petraeus.
"He loves you and everyone at Fox loves you. He says that if you're offered chairman (of the joint chiefs of staff), take it," Ms McFarland continued.
"But if you're offered anything else, don't take it, resign in six months and run for president."
Mr Petraeus was at the time the subject of fevered speculation among Republicans, who believed that he could return to the US as a respected war hero able to defeat Mr Obama in last month's election. The president's decision to make him CIA director was seen by some analysts as an attempt to sideline a potential political rival.
In their discussion, Ms McFarland added that Mr Ailes could resign from his role as Fox News chief to run a Petraeus 2012 presidential campaign.
"Tell him if I ever ran," Mr Petraeus said, laughing, "but I won't, but if I ever ran, I'd take him up on his offer."
Spokesmen for Mr Murdoch declined to comment.
Declaring "I love Roger, he's a brilliant guy", Mr Petraeus politely demurred and said he needed to focus on his home life after stepping down from commanding troops at war.
"It's never going to happen," he said. "My wife would divorce me. And I love my wife".
Mr and Mrs Petraeus, who have been married for 37 years, have retreated to their home to repair their relationship after he admitted having an affair with Paula Broadwell, who wrote his biography. The affair did not begin until some time after his comments to Ms McFarland.
Mr Petraeus resigned after it emerged the FBI was investigating the affair as part of an inquiry sparked by a complaint about threatening emails allegedly sent to a female friend of Mr Petraeus by Ms Broadwell.
In a separate development yesterday it emerged that South Korea has dropped Jill Kelley as an honorary consul following the scandal involving Mr Petraeus. Ms Kelley received harassing emails from Paula Broadwell, which sparked the FBI probe that ultimately uncovered Mr Petraeus' extramarital affair with his biographer and led to his resignation as director of the CIA. (© Daily Telegraph, London)
SEE CATRIONA PALMER PAGE 40