The attack from a small boat broke the window, spraying out glass that hit one of the pilots in the neck, the navy said.
The helicopter, which was taking part in a European Union anti-piracy operation named ‘Atalanta’, did not return fire to avoid endangering any possible hostages, it added.
It later returned safely to the Italian navy’s ship San Giusto, said European Union Naval Force spokeswoman Jacqueline Sherriff.
Somali pirates have raked in millions of dollars in ransoms from seized vessels in recent years in what has become a highly organized international criminal enterprise, spurring international navies to join forces in a crackdown.
NATO said in July increased international anti-piracy efforts were helping to reduce the threat to shipping.
“Shots were fired from a vessel thought to have been attacked and seized by suspected pirates,” the navy said in a statement.