Within hours, engineers "slung a line of code" to repel the electronic offensive.
A leader from the Pentagon confirmed Elon Musk's earlier claim that SpaceX successfully defended its Starlink satellite broadband internet service against Russian hacking and jamming attacks.
Musk tweeted on March 25 that all such attempts had been foiled up to that point.
Dave Tremper, director of electronic warfare for the Office of the Secretary of Defense, said he was impressed by how quickly the attacks were repelled.
"Starlink had slung a line of code and had fixed it and suddenly that was not effective anymore," Tremper said during the virtual C4ISRNet defense and military conference Wednesday. "How they did that is kind of eye-watering to me."
Tremper called Starlink an "interesting case study" and said the military could learn from how the team quickly addressed the problem.
"We need to be able to have that agility," he added.
After Russia invaded Ukraine in late February, Vice Prime Minister of Ukraine Mykhailo Fedorov requested Musk's help. The billionaire SpaceX founder responded by activating Starlink service in the country and sending a number of receiver kits to Ukraine.
SpaceX didn't immediately respond to a request for further comment.