MADRID, Spain (CNN) -- Two Somalis suspected of piracy will appear Tuesday before a Spanish judge, hours after they were transported by the military to Madrid, a court spokesman said.
One of the pirate suspects is taken off an aircraft by Spanish naval police.
The suspects are wanted as part of a pirate gang that captured a Spanish fishing boat in international waters off Somalia on October 2, according to a court document.
Spanish naval and air forces, which had rushed toward the captured fishing boat, detected the two suspects leaving it a day later and heading toward the Somali coast in a small boat.
Spanish troops fired on the vessel and forced it to stop. They then boarded the boat wounding one suspect, the document said.
The fishing boat, the Alakrana, and its 36-member crew remain in pirate custody, with Spanish naval and air forces monitoring the situation, according to a Defense Ministry spokesman and the boat's owner, the Echebaster Fleet of Bermejo, Spain.
Negotiations are under way to free the boat, Spanish media reports say, but the pirates might be demanding the release of the two suspects in Madrid as a condition.
The two suspects, identified only as Abdu Willy and Raageggesey in the court document, arrived Monday night at an air force base in Madrid under Spanish military guard.
It is thought to be the first time suspected Somali pirates have appeared before a Spanish judge.
They are expected to be charged with piracy and 36 counts of kidnapping, for each member of the crew still held. They include 16 Spaniards and 20 from Africa and Asia.
Defense Ministry photos showed both suspects wearing white prisoner uniforms. One walked off the plane, while the other was loaded into an ambulance on a stretcher.
One of the suspects arrived at Spain's National Court early Tuesday and was to appear before Judge Baltasar Garzon in a closed-door session, with a court-appointed lawyer and a translator.
The injured suspect is under guard in a Madrid hospital, and it was unclear whether the judge would go there for the initial hearing, according to CNN partner station CNN+.
The Echebaster Fleet said the Alakrana is the first of its ships to be captured by pirates, but there have been previous attempts on its ships.
A Spanish tuna fishing boat from another company was seized last year by Somali pirates and later released, after the ransom was reportedly paid.
Spain is part of a European Union task force against piracy in the Indian Ocean off Somalia. Spain's parliament agreed last January to increase Spain's presence with up to 395 troops and assets, including a frigate and aircraft.
Spanish Defense Minister Carme Chacon told lawmakers before the vote that the fight against piracy "is of vital importance for the defense of the geostrategic and economic interests of Spain, and will provide security to our fishing fleet," according to a defense ministry statement.