A total of 184 moderators employed in Nairobi by Sama, an outsourcing firm for Meta, filed a lawsuit in March, claiming their dismissal was "unlawful."
In a 142-page ruling, labor court judge Byram Ongaya said Meta and Sama were "restrained from terminating the contracts" pending the determination of the lawsuit challenging the legality of the dismissal.
"An interim order is hereby issued that any contracts that were to lapse before the determination of the petition be extended" until the case is settled, the judge added.
Ongaya also barred Facebook's new outsourcing firm, Luxembourg-headquartered Majorel, from blacklisting the moderators from applying for the same roles.
Meta - which also owns Instagram and WhatsApp - was also ordered to "provide proper medical, psychiatric and psychological care for the petitioners and other Facebook content moderators".
The company told the court of its intention to appeal the ruling.
The California-based tech behemoth has held that it has no official presence in the East African country and that the complainants are not employed by Meta.
The petitioners' lawyer, Mercy Mutemi, said it was "critical that the court has found Facebook is the true employer of its moderators," adding that they were "very pleased" with the orders.
"This ruling matters not just for the petitioners but the entire social media and AI industry," Mutemi said in a statement.
British-based legal activist firm Foxglove, which is supporting the case, said the ruling was "a major blow to the outsourcing model Facebook uses to avoid responsibility for its key safety workers."
Meta has faced scrutiny over the working conditions of content moderators who say they spend hours focused on hateful, disturbing posts with little regard for their well-being.
The company is facing two other legal cases in Kenya.
In 2022, a former South African employee of Sama, Daniel Motaung, filed a complaint in Kenya against Sama and Facebook claiming, among other things, poor working conditions and a lack of mental health support.
The labor relations court in Nairobi declared in February it had the jurisdiction to try Motaung's case. Meta has appealed the decision.
The social media giant is also facing another complaint in Kenya, where a local NGO and two Ethiopian citizens accused Meta of failing to act against online hate speech in Africa.
The complainants alleged this inaction resulted in the murder of a university professor in Ethiopia and called for the creation of a $1.6 billion fund to compensate the victims.