The pirates stood on deck.
The piracy reporting center quickly alerted the international naval force, which dispatched two helicopters and a warship to help deter the hijacking.
After arriving at the scene the helicopters fired at the pirates, forcing them to flee the ship.
There were no injuries during the five-hour ordeal.
It was the latest in a series of attacks by Somali pirates on Chinese vessels. On Tuesday, China said it was considering sending warships to the area to help battle piracy.
The announcement came during a unanimous UN Security Council vote to authorize nations to conduct land and air attacks on pirate bases on the coast of Somalia.