SAN FRANCISCO, Dec. 8 - In a black eye for a city that prides itself for tolerance, at least 18 police officers were suspended on Thursday for appearing in homemade videos for a Christmas party that parody the Police Department in skits described by officials as racist, sexist and homophobic.

Segments of the videos were released late Wednesday by Mayor Gavin Newsom and Police Chief Heather Fong. The videos include scenes of uniformed and plainclothes officers mocking the homeless, women, Asians, African-Americans and gay men. In one segment, a mock scene has a black woman yelling after apparently having been hit by a patrol car.

At a news conference, Chief Fong called the videos "egregious, shameful and despicable." Mr. Newsom told reporters he would convene a "blue ribbon" panel and promised, "We're going to make sure that it ends, it ends immediately."

The president of the San Francisco Police Officers Association said the videos were meant as "comic relief" but acknowledged that they were offensive and issued a public apology.

"We are absolutely certain that none of the officers involved participated in the making of these comic parodies with the intent to disparage any individual or group," the union president, Gary Delagnes, said. "These were meant as comic relief, parodies of police work."

Officials withheld the names of all but one suspended officer, Andrew Cohen, 39, who taped and edited the videos and posted them on his personal Web site. Officer Cohen and most of the others worked at the Bayview Hunters Point station, in a largely black and low-income district with a high crime rate.

The video clips rattled many African-Americans, who have for years accused the department of racism and sexism.

"That video is not funny at all," said Van Jones, founder of Bay Area PoliceWatch, which monitors the police in the Bay Area. "It's terrifying. The running over a homeless black woman. That's funny? It shows the contempt for people of color and women. That is the kind of frat-boy mentality encouraged in the Police Department."

Mr. Jones's group called on the city to fire the officers, thoroughly review their cases to make sure they acted without bias and resolve "the backlog of wrongful-death disciplinary cases in which black families allege racial bias in the police killings of their loved ones."

Clips from the parodies were on Officer Cohen's Web site for at least three days, although all the vignettes have been removed. In one video, "The Ladies Man," described as a spoof on the television series "Charlie's Angels," the former captain at Bayview Hunters Point, Rick Bruce, was talking to three female officers, licking his lips and flashing his tongue at the camera. Another video, "A Day in the Life of Hamster and Big Dummy," showed two officers napping or reading while ignoring a crime dispatch.

Mr. Delagnes of the union bemoaned the fact that "every lefty in San Francisco is going to love this."

"We stand behind our officers," said Mr. Delagnes, who said many of the officers in the videos were decorated. "At the same time, we recognize the stupidity of these acts."

He said that the suspended officers had no idea that Officer Cohen would post them online and that the officers had expressed emotions from "embarrassment to feelings of betrayal."

Officer Cohen's lawyer, Daniel Horowitz, told reporters on Wednesday that his client had been slandered by the department. Mr. Horowitz acknowledged that the videos were sophomoric but said they were intended only as an internal spoof. Officer Cohen, in an interview with CNN on Thursday, said the videos were an inside joke and criticized Chief Fong for making them public.

Another lawyer for Officer Cohen, Martin Garbus, said, "They are making a mountain out of a molehill."

Sgt. Joe Reilly, secretary of the San Francisco Police Commission, said it was likely that the suspensions would be referred to the panel, which has the final word on discipline. Important questions, Sergeant Reilly said, would be whether the officers were on duty, , whether Officer Cohen or others used department equipment and whether the racial or sexual references could be construed as violating the police code.

"The department has very strict rules on appropriate behavior with respect to race, gender and religion," Sergeant Reilly said.

Those rules also require the department to have hearings for each officer within five days of a suspension to see whether they may return to work. A spokesman would not say whether the officers were suspended with or without pay.