The boat’s crew of 26 included 13 Chinese and 12 Vietnamese nationals, as well as a Taiwanese captain.
The Shiuh Fu No 1 was seized off the coast of Madagascar in December 2010 before being taken to Somalia.
Taiwan’s foreign ministry said the crew was released after the boat’s owner completed ransom talks, the AFP news agency reports.
The released hostages were taken to Tanzania by the Chinese navy vessel, Taiwan’s foreign ministry said.
“We appreciate the assistance of the European Union, international anti-piracy organisations, China and other relevant countries,” it added in a statement.
The release of the crew was also confirmed by China’s foreign ministry.
Chinese ships have undertaken anti-piracy operations off the coast of Somalia since late 2008. In early 2010, Beijing agreed to join a multi-nation effort to protect shipping in the Gulf of Aden and nearby stretches of the Indian Ocean.
Military vessels from Nato countries, the US, China, Russia, Japan and India are now also involved in patrolling an area of ocean which is about the same size as western Europe.
Two decades of war in Somalia have left the country without a fully-functioning government, making it hard to deal with piracy.
As the pirates have expanded their operations, they are using bigger ships and equipment funded by the large ransoms paid for the release of hostages.
Currently, they are believed to be holding around seven other hijacked vessels, and dozens of crew members.