ANN ARBOR, Mich. – In a blunt caution to political friend and foe, President Obama said Saturday that partisan rants and name-calling under the guise of legitimate discourse pose a serious danger to America’s democracy, and may incite “extreme elements” to violence.

The comments, in a graduation speech at the University of Michigan’s huge football stadium, were Obama’s most direct take about the angry politics that have engulfed his young presidency after long clashes over health care, taxes and the role of government.

Not 50 miles from where Obama spoke, the GOP’s 2008 vice presidential nominee, Sarah Palin, denounced his policies as “big government” strategies being imposed on average Americans.

“The fundamental transformation of America is not what we all bargained for,” Palin told 2,000 activists at a forum in Clarkston, sponsored by the anti-tax Americans for Prosperity Foundation.

Obama drew repeated cheers in Michigan Stadium from a friendly crowd that aides called the biggest audience of his presidency since the inauguration. The venue has a capacity of 106,201, and university officials distributed 80,000 tickets before they ran out.

In his 31-minute speech, Obama didn’t mention either Palin or the tea party movement that’s captured headlines with its fierce attacks on his policies. But he took direct aim at the anti-government language so prevalent today.

“What troubles me is when I hear people say that all of government is inherently bad,” Obama said after receiving an honorary doctor of laws degree.

“When our government is spoken of as some menacing, threatening foreign entity, it ignores the fact that in our democracy, government is us,” Obama said.

Government, he said, is the roads we drive on and the speed limits that keep us safe. It’s the men and women in the military, the inspectors in our mines, the pioneering researchers in public universities.

The financial meltdown dramatically showed the dangers of too little government, he said, “when a lack of accountability on Wall Street nearly led to the collapse of our entire economy.”

But Obama was direct in urging both sides in the political debate to tone it down. “Throwing around phrases like ‘socialists’ and ‘Soviet-style takeover,’ ‘fascists’ and ‘right-wing nut’ — that may grab headlines,” he said. But it also “closes the door to the possibility of compromise. It undermines democratic deliberation,” he said.

“At its worst, it can send signals to the most extreme elements of our society that perhaps violence is a justifiable response.”

Passionate rhetoric isn’t new, he acknowledged. Politics in America, he said, “has never been for the thin-skinned or the faint of heart. … If you enter the arena, you should expect to get roughed up.”

Obama said he hoped the graduates hearing his words can avoid cynicism and brush off the overheated noise of politics. In fact, he said, they should seek out opposing views.

His advice: If you’re a regular Glenn Beck listener, then check out the Huffington Post sometimes. If you read The New York Times editorial page in the morning, then glance every now and then at The Wall Street Journal.

“It may make your blood boil. Your mind may not be changed. But the practice of listening to opposing views is essential for effective citizenship,” he said.

The speech was part of a busy weekend for the president, including the White House Correspondents’ Association dinner Saturday evening near the White House and visiting the Gulf Coast this morning for a firsthand update on the massive oil spill.

The president’s appearance in Michigan — a battleground state in the 2008 White House race that’s likely to play a big role in the fall congressional campaign — comes as the state struggles with the nation’s highest unemployment rate, 14.1 percent.

In the Republicans’ weekly radio and Internet address, Rep. Pete Hoekstra, R-Mich, said Obama’s visit was a chance “to show the president, firsthand, the painful plight of the people of Michigan.”

Many of the graduates Obama addresses will soon learn how tough it is to find a job in this economy, Hoekstra said, adding that the share of young Americans out of work is the highest it’s been in more than 50 years.