A federal court has ruled a Mexican woman with no legal status in Canada will be able to remain in the country until she has a court hearing to regain custody of her son.

Ivonne Hernandez was supposed to be removed from Canada this coming Friday, but on Tuesday a federal court ruled she may remain until March 6, the date of her custody hearing.

Hernandez initially came to Canada in 2009 and filed for refugee status, a claim that was rejected in 2011.

However in the interim Hernandez had married a Canadian citizen and had a child with him.

Soon after her claim was refused she sought help from a women's shelter and made a claim of domestic abuse against her spouse.

She has since lost custody of her son, in part because of her lack of legal status in Canada.

Her lawyer, Stewart Istvanffy, said he knew he had a solid case to delay the deportation.

"Normally these types of cases are supposed to take place in the country where both parents have been living with the baby so if they dump her in Mexico she has no rights to her baby and she may never see the baby again," said Istvanffy.