BERKELEY — Outspoken talk-show host Bill Maher appeared Saturday at UC Berkeley’s December graduation, greeted by loud cheers from the audience and a handful of silent demonstrators protesting the comedian’s statements about Islam.

Maher delivered the keynote speech at the winter commencement ceremony, where about 500 students were honored. During his 15-minute address, Maher mentioned Cal’s tradition of dissent, noting it was the 50th anniversary of the campus’ free speech movement.

“C’mon, it’s Berkeley. I think I can speak freely here,” he said. “I mean, I hope I can.”

The audience responded with cheers.

Maher’s selection this fall as keynote speaker prompted a student-led movement to rescind his invitation, including an online petition that gathered nearly 6,000 signatures. On his HBO show, “Real Time with Bill Maher,” he reaffirmed his decision to speak at the event but left open the possibility of canceling his appearance if his presence would cause too much of a distraction.

A small group of protesters gathered outside Haas Pavilion before the ceremony, saying that UC Berkeley Chancellor Nicholas Dirks was supporting racism and Islamophobia by allowing Maher to speak. A handmade sign outside the arena read: “I’m oppressed by Islamophobia, not Islam.”

At one point during Maher’s speech, a group of protesters silently rose in the audience, holding up a series of placards that read,” Dear (administrators), don’t Maher our commencement.”

Maher indirectly referenced the controversy in his remarks, saying: “Liberals should own the First Amendment the way conservatives own the Second Amendment.”

“If you call yourself a liberal, you have to fight oppression from wherever it comes … that’s what makes you a liberal.”

He also urged UC Berkeley graduates to avoid the perils of group think. “That’s the last thing I’ll suggest to you — be a free thinker,” he said. “One reason our politics is so screwed up is that it’s gotten so tribal.”

Maher is no stranger to political controversy. He was sharply criticized in late 2001 for comments about the Sept. 11 attacks on his late-night talk show, “Politically Incorrect.” The network canceled the show nine months later.

Maher, producer and star of the documentary “Religulous,” is a frequent critic of all organized religion.

He often speaks out about Islamic extremism, but he drew criticism this fall when he said on his show that Islam is “the only religion that acts like the Mafia — that will (expletive) kill you if you say the wrong thing, draw the wrong picture or write the wrong book.”

Some Muslim students on campus were outraged when they learned Maher would give the keynote address Saturday. Many argued his views on Islam and violence spread fear and bigotry against Muslims, and that he did not deserve the elevated status afforded a commencement speaker, instead of a campus lecture, for example.

Maher recently promised on his show, in its 12th season, that his speech would be about the graduates. He also suggested that his detractors did not embrace the campus’s legacy of free speech.

Under pressure from students unhappy with the choice, the student group that invited Maher later voted to take back the speaking offer — only to have UC Berkeley Chancellor Nicholas Dirks intervene, saying it was a matter of free speech and that Maher was still welcome.

Staff writer Katy Murphy contributed to this report. Contact Chris De Benedetti at 510-293-2480. Follow him at Twitter.com/cdebenedetti.