The Frida Kahlo doll, launched in March by US toy giant Mattel, has drawn criticism for putting a painter known for defying gender norms into the plastic body of Barbie.
It also drew a lawsuit from Kahlo's relatives, who claimed Mattel used the painter's image without their authorisation and criticised the company for lightening her skin, feminising her features and omitting her famous unibrow.
The court ruling bans sales of the Frida Barbie immediately in Mexico, or any use of the "brand, image and works of Frida Kahlo" by Mattel.
It can still be appealed.
The family said it would wait for the final outcome of the Mexican case, then launch a similar lawsuit in the United States.
"This litigation is in its first stage. We asked the judge to grant certain precautionary measures to protect our rights to Frida Kahlo's intellectual property," said the family's lawyer, Pablo Sangri.
Mattel's Mexico office did not immediately respond to requests for comment
"I'm thrilled (with the decision), I think justice is finally being done," Kahlo's great-niece, Mara Romeo, told AFP.
She said the case is not just a dispute over rights; it is about who her aunt really was.
"It should have been a much more Mexican doll, with darker skin, a unibrow, not so thin because Frida was not that thin... dressed in more Mexican clothing, with Mexican jewellery."
Kahlo, who died in 1954 and was married to the famous Mexican muralist Diego Rivera, is today considered one of the great painters of the 20th century, particularly for her self-portraits, often brimming with pain and isolation.
Her instantly recognisable look - unibrow, thick black braids, flowery, hand-embroidered Mexican "tehuana" dresses - and the boldness with which she wore it have made her a pop icon.
In recent years, her image has been stamped onto an explosion of consumer products: nail polish, bags, shoes, coffee mugs and more.
More about: FridaKahlo