Goldsmith, 77, is currently featured in Dos Equis commercials offering his take on Halloween-costume parties: “A little mystery can go a long way. I suggest you have it lead back to your place. Stay thirsty, my friends.”

His silky deep voice is actually a dub-in by actor Will Lyman.

Born in 1938, Goldsmith began his career in the New York ­theater.

In 1966, he skipped out to California and ultimately made more than 350 television appearances over several decades.

His career has been filled with ups and downs. While he appeared in the “Perry Mason” TV episode “The Case of the Blonde Bonanza,” he later couldn’t make ends meet and took odd jobs including driving a garbage truck and working in construction.

In the 1976 film “The Shootist,” he played a villain shot between the eyes by John Wayne.

The Greenwich Village Halloween Parade in 2013.Riyad Hasan

He started marketing businesses in the 1980s and retired from Hollywood for some years.

He purchased a home in the ­Sierra mountains and has lived quietly on a sailboat moored in Marina del Rey.

He has also taught theater at Adelphi University in Garden City, LI.

In a 2011 interview, Goldsmith told a trade publication that he was thrilled with the Dos Equis gig after decades of toiling mostly in obscurity.

“I’m an ‘overnight’ success ­after 40 years,” he quipped.

Earlier this year, Los Angeles agency Gold Levin Talent sued him, claiming he owes them 10 percent of the nearly $2 million he is expected to earn for 2015-16.

In court papers, the agency referred to him as “The Least Honorable Man in the Entertainment Business.”