NEW DELHI - The Indian navy captured 23 pirates who threatened a merchant vessel in the lawless waters of the Gulf of Aden, and a German naval helicopter thwarted another attack yesterday on a freighter being chased by speedboats off Yemen.

The successes came days before Secretary of State Condoleezza Rice was to ask the United Nations to authorize "all necessary measures" against Somalian pirates.

An Indian navy ship, the Mysore, was escorting merchant ships in waters off Somalia's coast yesterday when it received a distress call from seamen on board the merchant vessel Gibe, who said they were being fired on by two fast-approaching boats.

The Mysore and its helicopter sped to the scene, and the pirate boats tried to escape when they saw them, according to a statement from the Indian government.

Indian marine commandoes boarded the pirate boats and seized "a substantial cache of arms and equipment," including seven AK-47 assault rifles, three machine guns, a rocket-propelled grenade launcher, and other weapons, the statement said.

The pirates were from Somalia and Yemen, two countries on the coast of the Gulf of Aden.

Most foreign navies patrolling the Somali coast have been reluctant to detain suspects because of uncertainties over where they would face trial, since Somalia has no effective central government or legal system.

Also yesterday, a German military spokesman said a navy frigate had chased away pirates in speedboats pursuing an Ethiopian freighter off the coast of Yemen.

The German frigate responded to a distress call from the freighter, and a helicopter took off from the deck to investigate. The pirates turned away from the freighter as the helicopter flew overhead, said the spokesman, who declined to give his name in line with military policy.