The Dutch frigate Tromp rescued the ship and its crew at around 1140 GMT on Monday about 900 kilometres (560 miles) east of the Somali coast, the ministry said in a statement.
A Dutch soldier was slightly wounded in the operation, during which the troops exchanged gunfire with the pirates who had come aboard with the help of a mother ship and two attack boats.
The frigate had received a distress signal from the German container ship Taipan about four hours earlier, the statement said.
“The ship had been attacked by pirates and the crew had hidden in a secure space on board,” the ministry said.
When it arrived, the frigate sounded alerts and fired warning shots which sent the mother ship fleeing, it said.
Navy commandos then descended from a helicopter onto the bridge of the Taipan and arrested 10 pirates, it said. The 15 members of the crew emerged “safe and sound.”
“Despite the damage on the bridge caused during the operation, the boat was able to continue its route alone,” it said.
The arrested pirates were taken onboard the Dutch frigate.
It had not been decided what would be done with them, defence ministry spokesman Robin Middel told AFP, without giving the nationalities of the pirates or the crew of the German vessel.
The Dutch navy launched the operation as part of an EU naval mission called Operation Atalanta which protects shipping along the key route off Somalia.
EU Navfor has said that in March it collared 18 pirate gangs, destroyed 22 skiffs and apprehended some 131 pirates for prosecution.
But there are still eight vessels and 157 hostages in the hands of Somali pirates, an official said on March 31.