The pirates had briefly seized three other vessels earlier before Yemeni forces freed them, a Yemeni official said.
Yemen, one of the world's poorest countries, lies across the Gulf of Aden from Somalia and relies heavily on its exports of about 200,000 barrels of oil per day.
Pirates have taken millions of dollars in ransom payments by taking control of ships and holding crews hostage over the last year.
They have stepped up attacks on ships passing through the Gulf of Aden, an important route for ships carrying oil and cargo, since February.
Recent good weather has helped pirates stage their attacks on ships, even though foreign navies are running patrols off the Somali coast.
Pirates attacks almost doubled in the first quarter of 2009, with nearly all of them due to Somalia, the London-based International Maritime Bureau says.