US President Barack Obama has been accused of sexism after singling out a female California attorney for special praise.

At a fundraiser hosted by Levi Strauss heir John Goldman and his wife Marcia in Atherton, California, Obama introduced attorney general Kamala Harris as "the best-looking attorney general in the country."

"You have to be careful to, first of all, say she is brilliant and she is dedicated and she is tough, and she is exactly what you'd want in anybody who is administering the law, and making sure that everybody is getting a fair shake," said Obama.

"She also happens to be by far the best-looking attorney general in the country -- Kamala Harris is here," Obama said triggering laughter and applause form the public.

Untroubled by any potential controversy, Obama continued: "It's true. Come on. And she is a great friend and has just been a great supporter for many, many years."

Harris, of Jamaican and Indian origins, is often dubbed as "the female Barack Obama" and has been tipped as a potential gubernatorial candidate and also as a future Supreme Court justice.

Obama's remarks about the 48-year-old were condemned as disrespectful and sexist about social media, and divided US political commentators.

"For those who don't see a problem here, the degree to which women are judged by their appearance remains an important hurdle to gender equality in the workforce," wrote Jonathan Chait of New York Magazine.

"It's not a compliment. And for a president who has become a cultural model for many of his supporters in so many other ways, the example he's setting here is disgraceful."

"Does merely stating the obvious make the president sexist? More wolfish than sexist, I'd say. And this may be a little problem he needs to work on," LA Times journalist Robin Abcarian wrote.

"President Obama prides himself on telling the truth. And when he reportedly said that California Attorney General Kamala Harris is 'by far, the best looking attorney general,' he spoke the God's honest truth." Jonathan Capehart wrote on the Washington Post, adding that the comment was the offspring of Obama's friendship with Harris.

"Judging by some of the comments I've seen on Twitter you'd swear the president was guilty of luridly cat-calling a woman he doesn't know. If I thought for one moment that's what was going on, you better believe I'd hammer him for it. But that's not the case here. Far from it. So lighten up, people," Capehart wrote.

Obama Harris
President Barack Obama and California Attorney General Kamala Harris (Reuters)

Obama's 'history of sexism'

Nevertheless it wasn't the first time Obama is accused of sexism.

During the 2008 democratic primaries against Hillary Clinton, Obama received widespread criticism over several expressions he used to address his future Secretary of State.

In January that year, after Clinton had acknowledged that Obama had a "likable" personality whereas, at the same time, she was accused of lacking in character, Obama responded saying: "You're likeable enough, Hillary."

A month later Obama said Clinton's "claws" had come out to describe her aggressive tones.

The sexist climax towards Clinton was reached in April when Obama told ABC: "You know, over the last several weeks since she fell behind, she's resorted to what's called 'kitchen sink' strategies. She's got the kitchen sink flying, and the china flying, and the, you know, the buffet is coming at me."

The same year the future president called an ABC reporter, who asked him a question, "sweetie" before apologising.

Months later, during the presidential race against Republican John McCain, Obama sparked controversy over a remark which some said was directed at McCain's running mate Sarah Palin.

"You know, you can put lipstick on a pig," Obama said, "but it's still a pig." He has always denied the remark was aimed at Palin.

More recently in Ron Suskind's 2011 book Confidence Men: Wall Street, Washington, and the Education of a President, former White House communications director Anita Dunn was quoted as describing the office as a "genuinely hostile workplace to women."

Dunn later said Obama addressed the issue once informed of women's concerns.