Trini López, a singer and guitarist who became a nightclub staple and international superstar in the early 1960s, recording hit versions of “If I Had a Hammer” and “Lemon Tree” before appearing as one of “The Dirty Dozen” during a brief stint as an actor, died Aug. 11 at a hospital in Palm Springs, Calif. He was 83.

The cause was complications of covid-19, said his personal assistant Oralee Walker.

Mr. López, the son of Mexican immigrants, grew up in an impoverished Dallas neighborhood and turned to music after his father bought him a $12 guitar at a pawnshop. He had just been spanked for hanging out with “the wrong kind of kids,” as Mr. López told the story, and his father was racked with guilt.

Learning the instrument, a black Gibson acoustic that his mother derided as “a stick,” set him on a path from North Texas street corners to Paris music halls to the Copacabana nightclub in New York, where he performed before sold-out crowds who danced to his electrified takes on the Mexican folk song “La Bamba” and the Pete Seeger-Lee Hays classic “If I Had a Hammer.”

Singing the popular songs of the day — country, rock, folk and a cover of “America” from “West Side Story” — he defied music industry skeptics who told him he needed to change his name, believing no one would buy an album from a musician with a Latino name. One record-label executive suggested he call himself Trini Roper.

“I insisted on keeping my name López,” he told the Dallas Morning News in 2017, explaining that he wanted to differentiate himself from Mexican American artists such as Vikki Carr and Freddy Fender, who performed under stage names. “I’m proud to be a López. I’m proud to be a Mexicano.”

Mr. López received early support from Buddy Holly and Frank Sinatra, who suggested he drink tea with honey to prepare for performances, before making his major-label debut with “Trini Lopez at PJ’s” (1963), produced by Sinatra’s conductor and arranger Don Costa. The album was recorded live at a nightclub in Los Angeles and reached No. 2 on the pop charts, propelled by Mr. López’s up-tempo recording of “If I Had a Hammer.”

“He does not expect his audiences to know any of the lyrics,” New York Times music critic John S. Wilson wrote the next year. “In fact, he encourages them to avoid lyrics by invariably leading them into ‘La-la-la-la-la.’ While they give vent to their enthusiastic ‘la-la’s,’ he decorates the melody with whirring, bird-like noises and bright figures on his guitar.”

During a tour across Europe and Latin America, Mr. López drew more encores than the Beatles at the Olympia concert hall in Paris, played before 23,000 listeners at a packed Berlin arena, drew an audience of 60,000 in Buenos Aires and broke the attendance record at the popular Terraza Casino nightclub in Mexico City, according to Billboard magazine.

His later hits included a cover of the Will Holt folk song “Lemon Tree,” which reached No. 20 in 1965, as well as “I’m Comin’ Home, Cindy,” “Michael,” “Kansas City” and “The Bramble Bush,” which he performed in the popular 1967 movie “The Dirty Dozen,” starring Lee Marvin and Ernest Borgnine.

Mr. López played a criminal who, along with a group of convicts including Charles Bronson, Jim Brown, John Cassavetes and Telly Savalas, is enlisted for a dangerous World War II mission behind enemy lines.

His character, Pedro Jiminez, was killed off in a parachute jump after Mr. López left the production before filming was completed. Mr. López later said he returned home at the suggestion of Sinatra, after shooting ran over schedule.

“It would never stop raining, and we couldn’t shoot,” he told the Morning News in 2002. “So Mr. Sinatra flew over to England where the movie was filmed and told me to leave. He told me, if you’re away from your fans for too long, they forget about you.”

While Mr. López’s brand of nightclub-friendly pop was increasingly out of fashion by the end of the 1960s, he never stopped recording. His more than 70 albums included “All Original Songs” (2016), his first record of all-original material, according to the Palm Springs Desert Sun.

“I was lazy,” Mr. López told the newspaper, explaining why he had gone so many years without writing his own music. “But I have a good excuse, too. I was traveling so much, I barely had time for myself. So, I started recording songs that I liked on the radio. I started listening to ‘Michael Row the Boat Ashore’ and ‘Lemon Tree,’ and thank God — by the grace of God — I did something for those songs to make them hits again.

“I made them bigger hits just by putting my own spin on the songs.”

Trinidad López III was born in Dallas on May 15, 1937. His parents worked low-paying jobs, at a time when White Texans “treated us Mexicans worse than the Blacks,” Mr. López told interviewer Gary James. His father had been a musician in Mexico and taught him “La Bamba,” made famous in the United States by rock musician Ritchie Valens.

Mr. López dropped out of high school his senior year and met Holly after performing in Wichita Falls, Tex. The fellow Texan invited Mr. López to record with his producer in New Mexico, but the session ended in disaster when the producer turned out to be prejudiced against Latinos, according to Mr. López. The producer insisted that he play guitar but not sing, and his bandmates went along with the idea.

“We were there a week and we recorded four instrumentals and I cried myself to sleep,” Mr. López said, according to Spencer Leigh’s biography “Buddy Holly: Learning the Game.” “And then we went to Texas and I dropped them off in their homes like a taxi driver.”

After Holly’s death in a 1959 plane crash, Mr. López was invited to join the musician’s former band, the Crickets. He moved to Los Angeles but never performed with the group, which was apparently too busy partying. “Texas people, they love to drink,” he said.

In search of a gig, Mr. López began performing at the Ye Little Club in Beverly Hills, leading to work at PJ’s nightclub and an introduction to Sinatra. He made his movie debut in the singer’s 1965 comedy “Marriage on the Rocks” and later had a few credits in TV shows such as “Adam-12,” playing a priest and parole officer in separate roles.

He never married and had no children. Survivors include an older sister.

Near the peak of his fame in the early 1960s, Mr. López designed guitars for the manufacturer Gibson, including a sought-after model favored by musicians including Dave Grohl of the Foo Fighters, whose punk-influenced rock sound marked a radical departure from Mr. López’s gentle pop.

“I guess they’re not only fans of me as an artist, but they love the guitar,” Mr. López told Gibson’s website in 2011. “I’m not Dave Grohl’s biggest fan of course, but I’m definitely a fan. I’m just glad that people remember me.”