The FBI's newly discovered evidence on Alshamrani's phone signals the end of a spat between Attorney General William Barr and Apple Inc.
Alshamrani was killed by a sheriff's deputy after his rampage at a classroom building.
In disclosing details of the terror investigation on Monday, the Trump administration criticised Apple for refusing to help unlock the gunman's phones, which he had attempted to destroy before he was shot dead following the attack.
Alshamrani was in touch over time with al-Qaida in the Arabian Peninsula (AQAP), including its leadership up until the attack, according to one of the officials.
Apple has denied Federal Bureau of Investigation requests to unlock its iPhone devices in several high profile mass shooting cases, citing larger concerns over privacy. He was found with a second damaged phone, which led investigators to believe there was important information on the devices.
Mohammed Alshamrani had been speaking regularly with a contact with AQAP and was "certainly more than just inspired" by the terror group, Mr Wray said when asked if the attacker had been "directed" from overseas.
"If not for our FBI's ingenuity, some luck, and hours upon hours of time and resources, this information would have remained undiscovered", Barr said.
The gunman killed three US sailors at a naval air base station in Pensacola Florida last year
Wray said the 21-year-old Saudi had expressed a desire to learn to fly years ago with plans for a "special operation", enlisting in the Royal Saudi Air Force and joining flight training in the United States. Wray said the shooter was "meticulous" in his planning, making pocket cam surveillance videos and a final will saved in his phone, which al Qaeda later released.
"In just the short time since we finally accessed that evidence, we and our partners have already put it to good use", Wray said.
"So far Apple has not given us any substantive assistance", Barr said at a press conference.
If Alshamrani was directed or trained by al Qaeda, it would mark the first time since 9/11 that a foreign terrorist organization had done so in a deadly attack in the U.S., according to New America, a think tank.
Law enforcement officials left no doubt that Alshamrani was motivated by jihadist ideology, saying he visited a New York City memorial to the attacks of September 11, 2001, over the Thanksgiving holiday weekend and posted anti-American and anti-Israeli messages on social media just two hours before the shooting.
Apple has previously said encryption protects the privacy and security of its law-abiding customers, while the American Civil Liberties Union has warned of tech companies being used by administrations and law enforcement for government surveillance. "In cases like this, where the user is a terrorist, or in other cases where the user is a violent criminal, a human trafficker, a child predator, Apple's decision has unsafe consequences for the public safety and the national security and is in my judgment unacceptable".
Apple did not immediately respond to a request for comment.
China's Wuhan almost doubles number of Covid-19 tests per day
The NHC said that 561 asymptomatic cases, including 30 from overseas, were still under medical observation. China has stopped foreigners entering the country as a precaution against imported infections.