(CNN) US Cyber Command launched a retaliatory cyberstrike last week against an Iranian spy group, according to a US official and a former US intelligence official familiar with the matter.

USCC attacked the spy group, which has ties to the Islamic Revolutionary Guard Corps, after Iran attacked ships in the region, the officials said.

The US official added the online strike targeted an Iranian spy group's computer software that was used to track the tankers that were targeted in the Gulf of Oman on June 13.

A spokesman for the Pentagon would not comment on the matter Saturday, saying that "as a matter of policy and for operational security, we do not discuss cyberspace operations, intelligence or planning."

Yahoo! News first reported the US cyberstrike against Iran.

Read More