"I am what I am, Leila," Mr. Spock declared. "And if there are self-made purgatories, then we all have to live in them. Mine can be no worse than someone else's."
Born in Boston on March 26, 1931, Leonard Simon Nimoy was the second son of Max and Dora Nimoy, Ukrainian immigrants and Orthodox Jews. His father worked as a barber.
From the age of 8, Leonard acted in local productions, winning parts at a community college, where he performed through his high school years. In 1949, after taking a summer course at Boston College, he traveled to Hollywood, though it wasn't until 1951 that he landed small parts in two movies, "Queen for a Day" and "Rhubarb."
He continued to be cast in little-known movies, although he did presciently play an alien invader in a cult serial called "Zombies of the Stratosphere," and in 1961 he had a minor role on an episode of "The Twilight Zone." His first starring movie role came in 1952 with "Kid Monk Baroni," in which he played a disfigured Italian street-gang leader who becomes a boxer.
Mr. Nimoy served in the Army for two years, rising to sergeant and spending 18 months at Fort McPherson in Georgia, where he presided over shows for the Army's Special Services branch. He also directed and starred as Stanley in the Atlanta Theater Guild's production of "A Streetcar Named Desire" before receiving his final discharge in November 1955.
He then returned to California, where he worked as a soda jerk, movie usher and cabdriver while studying acting at the Pasadena Playhouse. He achieved wide visibility in the late 1950s and early 1960s on television shows like "Wagon Train," "Rawhide" and "Perry Mason." Then came "Star Trek."
Mr. Nimoy returned to college in his 40s and earned a master's degree in Spanish from Antioch University Austin, an affiliate of Antioch College in Ohio, in 1978. Antioch College later awarded Mr. Nimoy an honorary doctorate.
Mr. Nimoy directed two of the Star Trek movies, "Star Trek III: The Search for Spock" (1984) and "Star Trek IV: The Voyage Home" (1986), which he helped write. In 1991, the same year that he resurrected Mr. Spock on two episodes of "Star Trek: The Next Generation," Mr. Nimoy was also the executive producer and a writer of the movie "Star Trek VI: The Undiscovered Country."
He then directed the hugely successful comedy "Three Men and a Baby" (1987), a far cry from his science-fiction work, and appeared in made-for-television movies. He received an Emmy nomination for the 1982 movie "A Woman Called Golda," in which he portrayed the husband of Golda Meir, the prime minister of Israel, who was played by Ingrid Bergman. It was the fourth Emmy nomination of his career — the other three were for his "Star Trek" work — although he never won.
Mr. Nimoy's marriage to the actress Sandi Zober ended in divorce. Besides his wife, he is survived by his children, Adam and Julie Nimoy; a stepson, Aaron Bay Schuck; and six grandchildren; one great-grandchild, and an older brother, Melvin.
Though his speaking voice was among his chief assets as an actor, the critical consensus was that his music was mortifying. Mr. Nimoy, however, was undaunted, and his fans seemed to enjoy the camp of his covers of songs like "If I Had a Hammer." (His first album was called "Leonard Nimoy Presents Mr. Spock's Music From Outer Space.")
From 1995 to 2003, Mr. Nimoy narrated the "Ancient Mysteries" series on the History Channel. He also appeared in commercials, including two with Mr. Shatner for Priceline.com. He provided the voice for animated characters in "Transformers: The Movie," in 1986, and "The Pagemaster," in 1994.
In 2001 he voiced the king of Atlantis in the Disney animated movie "Atlantis: The Lost Empire," and in 2005 he furnished voice-overs for the computer game Civilization IV. More recently, he had a recurring role on the science-fiction series "Fringe" and was heard, as the voice of Spock, in an episode of the hit sitcom "The Big Bang Theory."
Mr. Nimoy was an active supporter of the arts as well. The Thalia, a venerable movie theater on the Upper West Side of Manhattan, now a multi-use hall that is part of Symphony Space, was renamed the Leonard Nimoy Thalia in 2002.
He also found his voice as a writer. Besides his autobiographies, he published "A Lifetime of Love: Poems on the Passages of Life" in 2002. Typical of Mr. Nimoy's simple free verse are these lines: "In my heart/Is the seed of the tree/Which will be me."
In later years, he rediscovered his Jewish heritage, and in 1991 he produced and starred in "Never Forget," a television movie based on the story of a Holocaust survivor who sued a neo-Nazi organization of Holocaust deniers.
In 2002, having illustrated his books of poetry with his photographs, Mr. Nimoy published "Shekhina," a book devoted to photography with a Jewish theme, that of the feminine aspect of God. His black-and-white photographs of nude and seminude women struck some Orthodox Jewish leaders as heretical, but Mr. Nimoy asserted that his work was consistent with the teaching of the kabbalah.
His religious upbringing also influenced the characterization of Spock. The character's split-fingered salute, he often explained, had been his idea: He based it on the kohanic blessing, a manual approximation of the Hebrew letter shin, which is the first letter in Shaddai, one of the Hebrew names for God.
"To this day, I sense Vulcan speech patterns, Vulcan social attitudes and even Vulcan patterns of logic and emotional suppression in my behavior," Mr. Nimoy wrote years after the original series ended.
But that wasn't such a bad thing, he discovered. "Given the choice," he wrote, "if I had to be someone else, I would be Spock."