Lawyers have won an emergency court order allowing them to access a Christmas Island compound that is home to 12 asylum seekers, who the government claims are dangerous.

Solicitors are currently on Christmas Island gathering evidence for a class action on behalf of a 6-year-old being brought against the federal government that could affect thousands of asylum seekers.

Asylum seekers and facilities at Christmas Island Detention Centre in 2013. Credit:Getty Images

The lawyers have been there since Monday night, and were invited to inspect White compound, but the Department of Immigration and Border Protection (DIBP) had refused to let them enter the area, home to 12 asylum seekers, arguing it could constitute a security risk.

The Commonwealth's lawyer, Richard Stanley, told the court the solicitors could be in physical danger if they entered the compound. "DIBP members aren't allowed to go in there because of the perceived danger," he said.