LOS ANGELES — Sheriff Joe Arpaio, at once hailed and reviled as America’s toughest sheriff, sauntered into famously liberal Hollywood on Wednesday, traveling hundreds of miles from his home turf and disconcerting legal problems in Arizona to promote a documentary that offers, at best, an unflattering portrayal of his troubled 21 years in office.

Mr. Arpaio took the filmmaker’s invitation to attend the documentary’s screening at the Beverly Hills Film Festival as a chance for vindication, his shot at setting straight a record he only selectively embraces. Pink underwear for inmates held in the jails he oversees in Maricopa County? “There’s nothing degrading about it,” he said. Female chain gangs? “They love it,” he said in a deadpan voice. Inmates dying after rough handling by detention officers? “None of my officers have ever been convicted,” he asserted. (The county has nonetheless paid out tens of millions of dollars in legal claims linked to the deaths, as the documentary notes.)

A household name in Arizona, he is a divisive figure. He continues to feed rumors that he is going to run for governor, even as Republican gubernatorial candidates court his endorsement. He has raised millions from supporters despite the court-ordered supervision of his office, which was found to discriminate against Latinos, and a separate federal investigation over abuse of power, discrimination and excessive use of force by his officers, in the jails and on the streets.

“I know what can destroy me and what can’t, and I know how far I can go,” Mr. Arpaio said as he strolled largely unnoticed along the star-encrusted pathway here known as the Walk of Fame, an octogenarian in a black suit and clip-on tie parading among the tourists and street performers dressed in Elmo and Darth Vader costumes.

“You’re a sheriff?” asked Wonder Woman, nee Sara Fischel, while wrapping him in a golden lasso and posing for a picture.

Inside, the famous TCL Chinese Theater stood largely empty at showtime, a reminder, perhaps, that “celebrity” carries a different definition in Hollywood. There was no phalanx of photographers waiting for him. The red carpet was not rolled out until after the film.

“Where are the protesters? Where are the cameras?” Mr. Arpaio asked, sounding disappointed.

“They call me a media hound,” he said, “and that might be true.”

His decision to fly to Los Angeles to promote the documentary, “The Joe Show,” was curious, given the content of the narrative and the demands of his job; one of his deputies fatally shot an armed man on Wednesday as Mr. Arpaio dined on soup and ginger ale on Hollywood Boulevard.

In an interview, Larry King, one of the boldface names featured in the documentary, said that Mr. Arpaio can be “personally charming” but that his news value is grounded in the fact that he is “a person of importance who is outrageous, bizarre.”

Mr. Arpaio described himself as “arrogant, tough, sometimes.” Jennifer Braillard, whose mother, Deborah, slipped into diabetic shock in one of his jails and eventually died, called him “absolutely, completely inhumane and cruel.”

The film capitalizes on Mr. Arpaio’s penchant for publicity, using unrestricted access to his inner circle to profile the canny ways by which he has used the news media both to hone his brand and defuse crises. In one scene, he crosses his arms and taps his foot as 2,000 inmates in pink boxer shorts march to a neighboring jail before a cadre of reporters, doing exactly as his chief spokeswoman, Lisa Allen, had instructed him.

“I want you to look tough,” Ms. Allen says to him in the film.

Randy Murray, the movie’s director, started the project in 2004. He said he selected Mr. Arpaio from a list of notable Arizonans he was thinking about profiling at the time — like Janet Napolitano, then the state’s governor; the rocker Alice Cooper; and Senator John McCain — in part because “as soon as we talked to his office, it became clear it would be the easiest to deal with.”

Soon, Mr. Murray said he found himself covering “publicity stunts,” as he put it: children visiting their parents in jail, the sheriff’s volunteer posse searching for an ostrich lost in the desert, and a singing competition called “Inmate Idol.”

But there were also compelling story lines, like the jail deaths, Mr. Arpaio’s relentless pursuit of unauthorized immigrants, and the anticorruption unit he disbanded in 2010 after allegations that it was being used as a political tool against the sheriff’s adversaries in county government. (The unit’s failed criminal investigations eventually led to the disbarment of a former county attorney, Andrew Thomas, but no related punishment has befallen Mr. Arpaio.)

Through it all, Mr. Murray said, “It’s clear that the media has been Arpaio’s most pliable, valuable tool.”

Chris Newman, legal director of the National Day Laborer Organizing Network, an immigrant rights group that stands among Mr. Arpaio’s loudest critics, said the documentary likewise plays into the sheriff’s hands, exposing Mr. Arpaio’s faults while also giving him the exposure he so diligently seeks.

“The film doesn’t succeed in destroying him, and that’s the whole point — he always wins,” Mr. Newman said. “All the coverage turns him into a spectacle, a caricature, like a cartoon colored over a real photograph. It obscures the truth and makes the horror that he causes seem somehow less real.”

A version of this article appears in print on , on Page A15 of the New York edition with the headline: Sheriff Joe Arpaio Embraces His Hollywood Moment. Order Reprints | Today’s Paper | Subscribe