Republican presidential candidate Donald Trump called on Friday for a boycott of Apple products until it agrees to help the U.S. government unlock the cellphone of one of the killers in last year's shooting in San Bernardino, California.

"Boycott Apple until such time as they give that information," Trump said at a campaign event in Pawleys Island, South Carolina. "It just occurred to me."

Trump, front-runner for the Republican nomination in the Nov. 8 presidential election, made the off-the-cuff comment at a town hall-style event at a country club a day before the state's nominating contest.