The FBI is asking Apple Inc. to help unlock two iPhones that investigators think were owned by Mohammed Saeed Alshamrani, the man believed to have carried out the shooting attack that killed three people last month at Naval Air Station Pensacola, Florida.

In a letter sent late Monday to Apple's general counsel, the FBI said that although it has court permission to search the contents of the phones, both are password-protected. "Investigators are actively engaging in efforts to 'guess' the relevant passcodes but so far have been unsuccessful," it said.

The letter, from FBI General Counsel Dana Boente, said officials have sought help from other federal agencies, as well as from experts in foreign countries and "familiar contacts in the third-party vendor community." That may be a reference to the undisclosed vendor that helped the FBI open the locked phone of Syed Farook, the gunman who attacked a city meeting in San Bernardino, California, in 2015. The Justice Department took Apple to court in an effort to get the company to help the FBI open that phone.

Apple on Monday said the company had been working with the government.

“We have the greatest respect for law enforcement and have always worked cooperatively to help in their investigations," Apple said in a statement. "When the FBI requested information from us relating to this case a month ago, we gave them all of the data in our possession and we will continue to support them with the data we have available.”

A law enforcement official said there's an additional problem with one of the iPhones thought to belong to Alshamrani, who was killed by a deputy during the attack: He apparently fired a round into the phone, further complicating efforts to unlock it.

Another official said Alshamrani, a member of the Saudi air force who was taking flight training, apparently acted alone but cautioned that the investigation is not complete.

Download the NBC News app for breaking news

Attorney General William Barr said last month in an interview with NBC News that the Pensacola shooting "appeared to be" an act of terrorism, but officials have not yet formally offered any conclusion. "Even though the shooter is dead," the FBI letter said, agents want to search the phone "out of an abundance of caution."

According to the letter, the iPhones were sent to the FBI's crime lab in Quantico, Virginia. "We stand ready from a logistical standpoint to do whatever is needed of us to work with Apple in effectuating the court's order," it said.