The death of Leonard Nimoy last week was one of those rare losses to the culture that cuts across generations. As Mr. Spock, the ultra-rational, half-human, half-alien character he portrayed on “Star Trek,” Nimoy was instantly recognizable to sci-fi fans of all ages, from wizened old Boomers to hipster millenials — like the crowd who paused for a moment of silence at the Long Beach Comic Expo on Saturday, all of them giving Spock’s trademark Vulcan salute, to honor the passing of the 83-year-old actor.

While Nimoy personified Spock, the character was the invention of Gene Roddenberry, the creative genius behind “Star Trek,” a bold and imaginative wild-West adventure series set in the far reaches of the galaxies — “where no man had gone before” — that premiered in 1966, three years before the first man, Neil Armstrong, had stepped foot on the moon.

Roddenberry was born in Texas but he grew up in Los Angeles, an upbringing that is reflected in the groundbreaking racial and ethnic diversity in the series’cast. Many years later, Whoopi Goldberg, who played a recurring character in the 1990s’ spinoff series, “Star Trek: The Next Generation,” made a point of telling Roddenberry that the presence of Lt. Uhura, a communications officer played by Nichelle Norris, who is African-American, in the original cast had inspired her as a child.

“When I was a little girl,” Goldberg told Roddenberry,”it was like, ‘Oh, we are in the future.’ Uhura did that for me.”

Given Roddenberry’s interest in portraying diversity in “Star Trek,” the source of his inspiration for Mr. Spock seems counter-intuitive and surprising. In an interview in the Los Angeles Times in 1984, Roddenberry revealed that he’d based Spock, in part, on LAPD Chief William H. Parker, one of the department’s longest-serving, most-revered and ultimately most controversial chiefs:

It’s been Roddenberry’s secret over the years that the character of Spock, the pointy-eared Vulcan science officer of the USS Enterprise, was modeled partly on former LAPD Chief William H. Parker… It was 1948 when Roddenberry, then a pilot for Pan American on the New York to Calcutta route and a a B-17 pilot before that during World War II, realized the significance of a new gadget called television. “Some people have good pitch when it comes to music. I have good pitch when it comes to the future,” Roddenberry recalled. “I just saw this thing with the seven-inch screen, and I said this is the future.” Roddenberry decided his own future was as a television writer. The ideal training ground for that career, he concluded, was the Los Angeles Police Department. His father was an LAPD officer, and Roddenberry had been raised in Los Angeles. So there were some logical reasons for the unusual decision. He had also known Parker since he was a boy. “I quit my job with Pan Am and came out here from New York to see my dear and old friend who was then Inspector William Parker of the Wilshire Division,” Roddenberry said. “He wasn’t very enthusiastic about my plans. In fact, he did his best to talk me out of it … Bill was depressed about this career at that point,” Roddenberry continued. “It was not a nice, well-run police department in those days. He wasn’t the chief yet, and he felt he was at a dead end. He was considered an oddball at the time.” Roddenberry disregarded Parker’s advice and joined the LAPD in 1949. Parker’s fortunes had brightened considerably by then, and the following year he became chief. He proposed that Roddenberry do “normal police stuff” six months a year and work for him the rest of the time. It was an offer the young patrolman couldn’t refuse. The curious partnership lasted almost five years. Roddenberry was considerably to the left of Parker in his political and social views, but the two of them enjoyed long philosophical talks, and Roddenberry remembers the legendary hard-line chief as being almost a liberal on some subjects. “He played the right-wing autocrat, but there was another side to him,” Roddenberry recalled. The future creator of “Star Trek” was particularly impressed with Parker’s openness to new ideas and his diverse intellectual interests. Many years later, these became characteristics of Spock and his Vulcan philosophy of “infinite diversity in infinite combinations.” “Spock’s love of diversity came very much from my conversations with Bill and his love of diversity,” Roddenberry disclosed.

“Diversity” is an interesting choice of words. Parker was unquestionably intelligent, well-read and given to intellectual pursuits. But, as Gene Roddenberry undoubtedly knew, there were limits to Parker’s “love of diversity.”

Parker, who was appointed chief in 1950, is often credited with cleaning up the LAPD, which had been rife with corruption, especially racketeering, all the way up the ranks for decades. He’d joined the force in 1927, earned a law degree at night and served in the Army in World War II, earning a Purple Heart during the Normandy invasion. As chief, he reorganized the department by “regularizing” the ranks using a quasi-military approach to discipline in the ranks that became the standard for police departments nationwide and is still practiced today.

At the height of his career, William Parker was nationally prominent in law-enforcement circles, second only, perhaps, to FBI Director J. Edgar Hoover. In fact, Parker was a friend of Robert Kennedy, who as Pres. John Kennedy’s attorney general, briefly considered replacing Hoover with Parker as FBI chief. (It’s commonly assumed that Hoover likely used intelligence he’d gathered either on JFK or Parker, or both, to put the kibosh on his ouster.) Parker was also indirectly famous in popular culture through his association with television writer and producer Jack Webb, who based the no-nonsense, “Just the facts, ma’am,” law-enforcement style of the characters in his long-running radio and television series, “Dragnet,” on Parker’s disciplinary style.

So that’s one side of Chief Parker: the “right-wing autocrat” and rational imposer of order and discipline. He had another side that was quite different, however. In her definitive biography of Parker’s archenemy, Mickey Cohen: The Life and Crimes of L.A.’s Notorious Mobster, Tere Tereba writes that “Chief Parker’s techniques were hardly clean. He used paid informants and sanctioned entrapment … It has never been proven that Parker had been a bagman for disgraced Mayor [Frank] Shaw — as Mickey Cohen alleged — but other unseemly behavior couldn’t be completely hidden.” Tereba quotes Daryl Gates, who later served as LAPD chief but started his career at the department as Parker’s driver, recalling that Parker often drank so heavily that “words slurred and stairs became a hazard.” In certain quarters, Parker was known as “Whiskey Bill.”

In the end, though, it wasn’t hard-ball tactics, alleged corruption or drinking that led to Parker’s collapse in stature. It was an inflammatory comment he made in the wake of the 1965 Watts Riots in 1965. During the investigation that followed, Parker was asked to explain how the riots started. “One person threw a rock,” the chief explained, “and then like monkeys in a zoo, others started throwing rocks.” The remark created a firestorm, in part because it played into Parker’s reputation as a crypto-segregationist. Under Parker, the LAPD hired black officers but restricted them to “separate but equal”-style beats in predominantly black neighborhoods and, with a few notable exceptions — particularly LAPD Lt. Tom Bradley, who was later elected mayor of Los Angeles — prevented them from rising in the ranks.

Parker survived the controversy nonetheless, and a year later his supporters honored the embattled chief with a banquet. Sitting on the dais, Parker listened as one dignitary after another praised his record. But when the time came for him to speak, Parker rose from his seat and then dropped to his knees. Felled by a heart attack, he died in the ambulance moments later.

When Roddenberry spoke with the Times in 1984, 18 years after Parker’s death, it’s likely he said that his former boss loved diversity out of kindness to his “dear and old friend.” It’s also probably the case that Parker’s reputation as a reformer had not yet been overshadowed by his association with the city’s racist past, as is the case today. In 2009, for example, when Parker Center, the LAPD headquarters named in his honor soon after he died, was replaced with a new building, after a spirited debate about Parker’s legacy, the old name was retired and the new building was given a workaday name: LAPD Headquarters.

On the other hand, in 2012, Parker was sympathetically portrayed by Nick Nolte in “Gangster Squad,” an ahistorical, bizarrely fictionalized retelling of Parker’s campaign to arrest Mickey Cohen. Among the film’s many historical bloopers, Nolte, age 71, was about 30 years too old to play Parker, who would have been in his forties in 1949 when the movie was set. Worse, Parker was not yet chief that year, and worse still, although Mickey Cohen was arrested by the LAPD multiple times over the years on charges ranging from using foul language to murder, it was the IRS, not the LAPD, that sent him to prison.

William Parker died on July 16, 1966, just 53 days before “Star Trek” premiered, on Sept. 8. The Watts Riots a year earlier had been a national story, and Parker’s lead role had made him something of a household name. And yet no one — perhaps not even Leonard Nimoy — knew that Mr. Spock’s dual nature was Gene Roddenberry’s tribute to the late chief.

Today, now that his monument — the building that once bore his name — is gone, and leaving aside Nolte’s caricature in “Gangster Squad,” the memory of William H. Parker is destined for history’s trash heap, except for the fact that Roddenberry embedded a bit of his old boss’s conflicting natures into Spock, a character who has achieved cultural immortality thanks to digital technology and a new actor, Zachary Quinto, who has assumed Nimoy’s role.

In that sense, in Mr. Spock, the memories of both Leonard Nimoy and, to a degree, Bill Parker will — to borrow a phrase — live long and prosper.