The Australian Navy has rescued a group of sailors who were being held hostage by Somali pirates off the Horn of Africa.

The Defence Force says the pirates boarded the Yemeni-flagged boat several weeks ago and were holding three crew members hostage.

HMAS Stuart was in the area and sent a boarding crew to rescue the boat on Monday.

Defence says no shots were fired during the rescue and 15 pirates quickly surrendered to the Australian crew.

It says 11 AK-47 assault rifles with 16 magazines, a large quantity of small arms ammunition and a rocket-propelled grenade launcher with grenades were found during a search of the boat. The weapons were catalogued and thrown overboard.

Defence says the unarmed pirates were then offloaded into their skiff and given "adequate food, water, fuel and communications equipment" to make it to the Somali coast, and the Yemeni fishing dhow was escorted from the area.

Chief of Joint Operations Lieutenant General Mark Evans says he is pleased with the way HMAS Stuart's crew handled the mission.

"Stuart's boarding party did extremely well in maintaining the safety of the dhow's crew and ensuring a potentially challenging situation did not escalate," he said.

The Navy frigate is deployed to the Middle East conducting maritime security, counter-terrorism and counter-piracy operations with the Combined Maritime Forces.