As a Spanish warship looked on, a $3.3 million ransom was delivered by boat Tuesday and Somali pirates freed a Spanish trawler and its 36 crew members.
Spain's prime minister did little to deny paying off the hijackers _ one reason the lucrative attacks are on the rise.
"The government did what it had to do," Prime Minister Jose Luis Rodriguez Zapatero told a news conference in Madrid. "The important thing is that the sailors will be back with us. The first obligation of a country, of the government of a state, is to save the lives of its countrymen."
Somali pirates attacked two more ships on Monday and still hold about a dozen ships with more than 200 crew, including a British couple who were taken from their 38-foot sailboat last month.
Ali Gab, a self-described pirate, told The Associated Press the hijackers of the Spanish tuna boat Alakrana were paid $3.3 million in ransom, delivered by boat as sailors aboard a nearby warship watched.
After being freed, the trawler steamed away under the protection of two Spanish warships. All crew members were reported to be in good health after more than six weeks in captivity.
Spanish Deputy Prime Minister Maria Teresa Fernandez de la Vega told a news conference the Alakrana was headed for the Seychelles, where U.S. surveillance drones and several warships belonging to a multinational force are based.
The pirates had been pressing for the release of two colleagues captured by Spanish naval forces a day after the hijacking. The Spanish government had been trying to find some sort of legal formula that would allow it to try them and send them back to Somalia.
The two were charged with kidnapping and related charges Monday. De la Vega declined to say if Spain might seek some sort of agreement with Somalia.
"Now is the time for justice," she said. "Our prosecutors are acting in line with the principle of legality and impartiality, and our judges, who are an independent branch, will issue the verdict they deem appropriate."
Somali villager Ali Ahmed Salad said 12 armed pirates left the Alakrana shortly after noon on Tuesday and joined colleagues near the pirate-controlled town of Haradhere.
In April 2008, the Spanish government reportedly paid a ransom of $1.2 million to win the release of another Spanish trawler seized by pirates off Somalia with 26 crew members on board. That ordeal lasted a week.
Pirate attacks have been on the rise because the millions of dollars a successful hijacking can bring is a windfall in impoverished and war-ravaged Somalia.
The recent end of the monsoon season has brought calmer seas, allowing easier sailing for pirate skiffs that continue to take vessels despite the presence of an armada of warships from the United States, the European Union, NATO, Japan, South Korea and China.
The trawler had been seized Oct. 2 with 16 Spaniards, eight Indonesians and 12 crew from five African countries on board.
The sister of the second-in-command of the Alakrana spoke to her brother after his release.
"It took them by surprise and they still cannot really believe it," said Argi Galbarriatu, the sister of Iker Galbarriatu. "He told me the word to describe it is that they are relieved, and eager to get to port and come home."
Britain has refused to pay ransom for Paul and Rachel Chandler, whose boat _ the Lynn Rival _ was taken by pirates on Oct. 23.
Authorities believe the Chandlers, who are in their 50s, are being held on land in Somalia. Pirates have demanded $7 million for their release _ money the Chandlers' relatives say the couple doesn't have.
Pirates attacked two vessels Monday, capturing the chemical tanker MV Theresa and its crew of 28 North Koreans, the EU anti-piracy force said. In the second incident, pirates attacked a Ukrainian cargo ship with AK-47 rifles and rocket-propelled grenades.
Cmdr. John Harbour, a spokesman for the EU's anti-piracy force, said the Ukrainian vessel got away after private security guards on board fired on the pirates, wounding two. However, a purported spokesman for the pirates, Gedi Ali, said the ship was captured.
Pirate attacks in 2009 already have exceeded last year's total off the Horn of Africa, an international maritime watchdog group reported last month. A total of 306 attacks were reported between January and September, surpassing the 293 incidents recorded throughout 2008, according to the International Maritime Bureau's piracy reporting center in Kuala Lumpur, Malaysia.
Associated Press Writer Daniel Woolls contributed from Madrid.