A judge ruled that Francesco Schettino must remain in custody pending a later decision on whether to release him while authorities probe the running aground of the Costa Concordia on Italy's Tuscan coast.
But the judge said Schettino can be held on house arrest rather than in jail pending that decision, said his attorney, Bruno Leporatti. It was not clear late Tuesday whether Schettino had been moved to house arrest.
Leporatti said the decision was based on Schettino's promised cooperation and law that allows the suspect to remain under house arrest pending a final decision on custody.
Chief prosecutor Francesco Verusio said he did not know the grounds for the decision, which was made after the Tuesday afternoon court hearing.
"I am speechless," he said.
An Italian port official swore in frustration at the captain of the stricken vessel after it struck rocks Friday night, ordering him at least 10 times to return to the cruise liner and coordinate rescue efforts, transcripts of the recorded conversations published Tuesday show.
"You get on board! This is an order!" the port official told Schettino.
"You have declared 'Abandon ship.' Now I'm in charge. You get on board -- is that clear?" the official said in one of the conversations published by the Italian newspaper Corriere della Serra.
Schettino says at one point that he wants to go back on board, then refers to "other rescuers" and says something about a lifeboat being stuck.
"Get on board the ship and you tell me how many people are on board. ... Clear? You tell me if there are children, women, people with special needs," a coast guard officer tells Schettino.
"Get on board, (expletive)!" the officer curses in frustration.
During one conversation, Schettino first says he abandoned ship, only to appear to reverse course under questioning by an official, saying that he was "catapulted into the water" but remained on scene to coordinate the rescue.
"I did not abandon any ship," Schettino said, according to the transcripts.
Italian prosecutors confirmed that the quotes match ones in a transcript they were using in their investigation.
Schettino is under investigation by Italian authorities for his role in the disaster, which has claimed at least 11 lives.
Prosecutors say Schettino was on the bridge at the time and made a "grave error" that led to the disaster. The Italian coast guard and Costa Cruises, which owns the ship, are investigating why Schettino took the ship so close to land in an area known for its rocky sea floor.
"Preliminary indications are that there may have been significant human error on the part of the ship's master, Capt. Francesco Schettino, which resulted in these grave consequences," Costa Cruises said in a statement.
"The route of the vessel appears to have been too close to the shore, and the captain's judgment in handling the emergency appears to have not followed standard Costa procedures," the statement added.
Corriere della Sera reported that Schettino came close to Giglio to salute Mario Palombo, a legend among Costa Cruises' commanders, and as a gesture to the only Giglio native on board, chief steward Antonello Tievoli.