The pirates were armed with assault weapons and anti tank missiles, but the South Koreans managed to get the upper hand in a five hour fight.
Eight Somali pirates were killed, and five were captured. The 21 hostages were rescued.
During the rescue, the South Korean captain was shot by a pirate. He was taken by a U.S. helicopter to a nearby country for treatment, but the wound is not life-threatening, said Lt. Gen. Lee Sung-ho. The 20 other crew members were rescued unharmed and were in good condition.
A wife of one of the South Korean crew cried in gratitude as the weeklong hijacking came to an end. "Family members couldn't sleep or eat well and prayed for a safe return. I am very relieved," she said.
Only a handful of rescues in recent years have involved such peril to the crew. The daring and rare raid handed South Korea a stunning success in the battle against pirates who have long tormented shipping in the waters between Africa and the Arabian Peninsula.
"We will not tolerate any behavior that threatens the lives and safety of our people in the future," said South Korean President Lee Myung-bak.
Friday's raid marked the first rescue operation by a South Korean navy vessel that has been deployed in the Gulf of Aden to help fight piracy since 2009. "This operation demonstrated our government's strong will to never negotiate with pirates," Lt. Gen. Lee said.
The Associated Press contributed to this article