There was no precise information on the boat or the fate of its crew, whether international forces were involved in the rescue, or whether the crew had wrested back control on their own.
However, security sources said the boat was believed to be an Iranian fishing vessel seized earlier this week with 15 crew, held off the central Somali coastline.
"We heard heavy exchange of gunfire... Several of the pirates were killed and a boat they hijacked was freed," said Muktar Yakub, a fisherman in the Harardhere area, adding the boat had now disappeared from sight of the coast.
Piracy peaked in 2011, when Somali pirates held more than 700 hostages, but rates of attacks have tumbled, partly thanks to the posting of armed guards on boats as well as navy patrols.
More From This Section
But experts have warned that rampant illegal fishing by foreign trawlers off Somalia is threatening economic gains and could push communities back to maritime crime.
While illegal fishing was used by many pirates as an excuse for attacks - with an array of vessels seized including yachts, oil tankers and container ships - the issue could encourage a fresh round of piracy.
Two Iranian fishing boats were seized in March near Ceel Hur in central Somalia, but one boat escaped in August.
The other, the Siraj, is still being held, with 15 remaining crew held onshore, after four were freed by local authorities earlier this month.