The Egyptian Mansourah vessel with 25 crew members was hijacked on September 4 in the Gulf of Aden near Somalia.
The MENA news agency said the ship was released late Friday after protracted negotiations between the pirates and the Egyptian intelligence.
"The vessel is heading to home port. All crew members are feeling well," the agency said.
Earlier reports indicated that the pirates demanded a large ransom for the release of the hijacked ship, but according to Egyptian sources "they finally agreed to meet all Egyptian demands." The sources do not mention though whether the ransom has been paid.
Meanwhile, Reuters reported on Saturday that Somali pirates demanded a $35-million ransom for a Ukrainian ship they seized on Thursday, which was carrying 33 tanks and other military supplies to Kenya.
Ukraine's Foreign Ministry earlier cited the ship owner, Tomax Team Inc., as saying there were three Russian, 17 Ukrainian and one Latvian nationals on board the Faina ship, which was flying the Belize flag.
Pirates are increasingly active in the waters off Somalia, which has no effective government and no navy to police its coastline. The International Maritime Bureau said more than 30 incidents of piracy were registered in the region in 2007. More than 30 attacks have been committed so far this year off the coast of the East African nation.
At the beginning of June, the UN Security Council passed a resolution permitting countries to enter Somalia's territorial waters to combat "acts of piracy and armed robbery at sea."
A multinational task force comprising 12 vessels, including the French frigate Courbet, is patrolling the Gulf of Aden to deter piracy.
Russia's Navy has sent the Neustrashimy (Fearless) missile frigate to waters off the Somali coast to fight piracy in the region, but the Russian warship will conduct its patrols in the area independently.
"We are planning to participate in international efforts to fight piracy off the Somalia coast, but the Russian warships will conduct operations on their own," Adm. Vladimir Vysotsky earlier said.