Steve Hilton, a close friend who helped Cameron get elected in 2010 and worked with him in government, said the Conservative leader was only backing a "Remain" vote in the June 23 referendum because of his office.
"If he was a member of the public, or a backbench MP or a junior minister or even a cabinet minister, I'm certain that he would be for 'Leave'," Hilton told The Times newspaper in an interview.
"As prime minister he sees it from a different perspective, and that's perfectly reasonable... But I think that if he didn't have that perspective he would be for 'Leave'."
Cameron has been campaigning hard for a "Remain" vote in the referendum, criss-crossing the country with warnings that leaving the EU would put Britain's national and economic security at risk.
Also Read
Hilton was chief strategist for Cameron while he was leader of the opposition and then one his top advisors in government, before moving to the United States in 2012.
This week Hilton declared his support for a so-called Brexit while visiting Britain from California, where he has worked at Stanford University and founded a tech company, to promote his new book.
Cameron had publicly left open the possibility that he might back a "Leave" campaign pending the outcome of negotiations on reforms to Britain's membership with other EU leaders.
He announced he would back "Remain" after securing a deal in February that he said gave Britain "special status".
But critics, including Hilton, said it fell far short of what the prime minister had originally said was needed.