Judge Rosa Rodriguez said Elian Gonzalez should remain in Florida pending a court hearing by March 6, on the grounds that returning to Cuba could cause him "irreparable harm".

She granted temporary custody to one of the boy's Miami-based relatives, who have argued vehemently that he would suffer if he were made to return to an impoverished communist society.

But it was unclear last night what would ultimately become of Elian, who was found at sea last November after his mother and 12 other Cubans had drowned in an attempt to reach the Florida coast.

Lawyers in Miami said the court decision might be overruled by the US immigration services, which last week declared that Elian's father, Juan Miguel Gonzalez, was the child's legal guardian and that Elian should be returned to his custody in Cuba by this Friday.

Judge Gonzalez ruled that Elian, if returned to Cuba, "would be subjected to imminent and irreparable harm, including loss of due process rights and harm to his physical and mental health and emotional well-being".

The judge, an elected official in a largely Cuban-American district, gave temporary custody to Elian's great uncle, Lazaro Gonzalez, also giving him authority to ensure he remained in the US pending a full custody hearing. She requested that Juan Gonzalez travel from Cuba to argue the case for custody of his son, something he has hitherto refused to do, claiming he might be in danger of assault or kidnap. Cuban exiles say he is not allowed to speak freely by the Havana regime.

Spencer Eig, the lawyer for Elian's US relatives, called the ruling: "A great day for Elian Gonzalez and the constitution of the US. This will permit [him] his day in court."

The Florida court decision was expected to trigger protests in Cuba, where the fight over the child's destiny is seen as a symbol of the communist-run island's struggle against the US and the fiercely anti-communist Cuban-American exile community based in Florida.

The issue has become a hot political issue in the US, with a potential impact on this year's presidential elections. Cuban-American leaders have vowed that Vice-president Al Gore, the Democratic frontrunner for the presidency, will be made to pay the political price if the Immigration and Naturalisation Service (INS) attempts to deport Elian.

Mr Gore has distanced himself from the INS order for Elian's return, saying he would prefer the matter to be resolved in a courtroom.

White House officials yesterday said it would be left to the justice department to decide whether yesterday's court decision affected the INS ruling. A justice department spokesman said last night its lawyers had not yet had time to study Judge Gonzalez's decision.

Mr Eig said he did not believe the INS would try to overrule the court decision. "I believe the INS will give precedence to American law over Cuban law," he said. "Anyway, we didn't know Cuba had any laws."

Cuban-American leaders appeared on the court steps yesterday to applaud the decision and to confirm that they would continue to suspend their protest campaign against Elian's return.

Jose Basulto, the leader of the radical anti-Castro group Brothers to the Rescue, said: "This is a tactical victory. We don't know how this will evolve here, and I will have to talk to the lawyers about that."

The important issue, Mr Basulto said, was that Elian should "have his day in court", and that his father should come to Miami to give evidence. But, he promised: "If the court hears the case of this child and the court decides he has to go back to Cuba, we will accept that decision."

In an earlier attempt to block Elian's return, a Republican congressman, Dan Burton, subpoenaed the boy, requiring that he appear before a congressional committee on February 10.

An INS spokesman said yesterday the agency was still considering whether the subpoena had any bearing on its decision to send Elian home.