Apple CEO Tim Cook said that complying with a court order to help the FBI break into an iPhone belonging to one of the San Bernardino shooters would be "bad for America" and set a legal precedent that would offend many Americans.

"Some things are hard, and some things are right, and some things are both – this is one of those things," Cook told ABC News in his first interview since the court order was published in early February.

Apple's chief executive officer also said there should have been more dialogue with the Obama administration before the US Justice Department's decision to seek relief from a federal magistrate judge in California.

"We found out about the filing from the press," Cook said in an interview being aired on ABC World News Tonight. Apple has publicly said it intends to fight the court order and has until 26 February to respond.

The iPhone in question was used by San Bernardino shooter Rizwan Farook, who along with his wife went on a shooting rampage in December 2015 that killed 14 and wounded 22. The Justice Department wants Apple to help access encrypted information stored on Farook's county-owned iPhone 5C by writing software that would disable its passcode protections to allow an infinite number of guesses without erasing the data on the device. Apple has said the request amounts to asking a company to hack its own device, and would undermine digital security more broadly.