The SEAL special forces boarded the South Korean ship before dawn, freeing all the hostages and killing the pirates in cabin-to-cabin battles, they said.
Five others were captured.
"This operation demonstrated our government's strong will that we won't tolerate illegal activities by pirates any more," Lieutenant-General Lee Sung-Ho of the Joint Chiefs of Staff told a news briefing.
The South Korean skipper of the chemical freighter suffered a gunshot wound to his stomach during the raid but his condition is not life-threatening, the military said.
No commandos were hurt.
The rescue about 1,300 kilometres (800 miles) off northeast Somalia was seen as a major morale boost for the South's military.
It was strongly criticised for a perceived weak response to North Korea's shelling of a border island last November.
President Lee Myung-Bak, who authorised the operation, said the military carried out the raid perfectly under difficult circumstances.
"We will not tolerate any activities