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.
Local elder Abdulahi Bare said "seven of the pirates were killed and two others were seriously wounded" but the toll could not be independently confirmed.
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.
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.
Dozens of hostages remain in pirate hands. They include 26 sailors on the now wrecked fishing boat Naham 3, who have been held since March 2012.
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.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.