Obama
U.S. President Barack Obama speaks about the Supreme Court to students and faculty at the University of Chicago Law School, where Obama taught constitutional law for over a decade, in Chicago, April 7, 2016. REUTERS/Kevin Lamarque

President Barack Obama on Friday told donors that Republican presidential candidates Donald Trump and Ted Cruz were doing Democrats a "favor" by exposing extreme views within their party on issues such as immigration and national security.

"I actually think that Donald Trump and Ted Cruz have done us a favor," Obama said, referring to policy positions that would restrict Muslims and Mexicans from entering the country.

Obama said Trump and Cruz, the two front-runners in the Republican nomination contest ahead of the Nov. 8 presidential election, have upset mainstream "establishment" Republicans with their insurgent campaigns.

But he told about 100 people at the annual "signature" fundraising dinner for Nancy Pelosi, Democratic leader in the House of Representatives, that Trump had laid bare what some in the Republican party had been saying for years.

"He said, 'You know what? I can deliver this message with more flair, with more panache,'" Obama said.

Speaking in an opulent two-storey atrium with marble pillars in the home of billionaire oil heirs Gordon and Ann Getty, where donors paid $33,400 per couple to benefit the Democratic Congressional Campaign Committee, Obama mocked Trump.

"In 10 months, I will no longer be president of the United States. But in 10 months, I will - contrary to Mr. Trump's opinion - still be a citizen of the United States," he said, drawing laughter and cheers from the crowd.

Trump had long raised questions about whether Obama, who was born in Hawaii, was actually born outside the United States.

It was Obama's fourth stop on a fundraising swing through San Francisco and Los Angeles. Earlier, in San Francisco, Obama held a private roundtable at the Potrero Hill home of Susan Sandler and Steve Philips for the Democratic National Committee with about 25 people who paid up to $33,400 to attend.

He started Friday in Los Angeles with a breakfast event at the Brentwood home of "Spiderman" actor Tobey Maguire, closed to the media, where an undisclosed number of $33,400-tickets raised money for the Democratic Senatorial Campaign Committee.

On Thursday, he spoke at a fundraising dinner for the DCCC in a tent with seating for about 80 people outside the Bel Air home of Alan Horn, chairman of Walt Disney Studios, and Cindy Horn, an environmental activist.