The technology giant and the US government are locked in a showdown after a judge sided with investigators who want to mine data from the mobile phone used by Syed Farook who, along with his wife, killed 14 people in San Bernardino, California in December.

Federal Judge Sheri Pym ordered Apple on Tuesday to build special software that would give police a back door into suspects’ devices.

Tim Cook, Apple’s CEO, said the company would not comply with what he called a “dangerous” case of government overreach that could provide hackers with a “master key” to Apple’s encryption.

Tim Cook

“The government is asking Apple to hack our own users and undermine decades of security advancement that protect our customers - including tens of millions of American citizens - from sophisticated hackers and cybercriminals,” he said.

The US Justice Department countered that the victims of the terrorist attack deserved an investigation that “will leave no stone unturned”.

Mr Trump agreed, saying “we have to use common sense.”

“We have to open it up, and we have to use our heads,” the Republican front-runner said in an interview with Fox News on Wednesday.

“We should find out what happened, why it happened, and maybe there’s other people involved and we have to do that,” he added.

Mr Trump’s comments came as new polls showed him trouncing his rivals for the Republican presidential nomination.

He has consolidated his leads nationally and in South Carolina - where the next votes will be cast on Saturday - and a CNN poll released on Wednesday showed him up a whopping 26 points in Nevada, which votes on Tuesday.

The property mogul pointed to that poll to tout his advantage over Jeb Bush, the former Florida governor and his frequent sparring partner.

The tweet was widely mocked as an attempt to pander to the pro-gun Republican base in South Carolina, though Mr Bush said the gun was a gift from a local firearms manufacturer, and that he was “proud” to receive it.