A Canadian judge in Ontario made legal history last month by overturning a man’s last will and testament because his deathbed pleas were overtly racist.

Judge C.A. Gilmore overturned Jamaican-born Rector Emanuel (Eric) Spence’s will, because he had disinherited a daughter who gave birth to a white man’s child.

It is the first known example of a judge nullifying an entire will on the grounds that the motivations of the dead offended “public policy.”

Mr. Spence, who died alone in 2013, disowned his daughter when he found out she was carrying the infant. Instead, he left $400,000 to another daughter whom he barely knew in the U.K., largely out of anger and spite. The court documents show that Mr. Spence and his daughter, Verolin, had an excellent relationship until 2002.

Then, according to the ruling: “Verolin’s relationship with her father came to a dramatic end. She told her father that she was pregnant and that the father of her child was Caucasian. Her father exclaimed that he was ashamed of Verolin and from that point onwards, the deceased restricted his communication with her … He would not allow a white man’s child in his house.”

Mr. Spence refused all contact with his grandson, Alexander, who is now 11 years old.  In fact, he referred to the child to a family friend as his daughter’s “bastard white son.”

The ruling has been declared fascinating by several lawyers who study and specialize in estate law. Courts obviously do not hold up wills that grant assets on the condition that heirs do something illegal to obtain them — but being a racist isn’t illegal.

Previous precedents have also overruled wills that tried to grant posthumous gifts to entities that judges have deemed contrary to “public policy,” as well. Last year, for example, a New Brunswick court violated the will of coin collector Robert McCorkill, who bequeathed his fortune to a West-Virginia neo-Nazi group.

Mr. Spence didn’t explicitly disinherit his daughter on racial grounds in his will; he merely said he chose not to leave her his estate because the two had stopped communicating, which was objectively true.

What makes this week’s ruling even more extraordinary is that Mr. Spence didn’t explicitly disinherit his daughter on racial grounds in his will; he merely said he chose not to leave her his estate because the two had stopped communicating, which was objectively true.

Suzana Popovic-Montag, a managing partner at Hull & Hull LLP in Toronto who specializes in estate and trust law, said this ruling may “open the floodgates,” on similar challenges. “We’re imposing our personal feelings and emotions and morals on other peoples’ decisions and that’s where people aren’t comfortable,” she said.

Because Donna Spence has so far been unwilling to participate in the proceedings, it’s unlikely the ruling will ever be challenged. “That means we have binding precedent here in Ontario that says you can do this. The question is how are people going to use this?” Ms. Popovic-Montag asked.

Howard Black, an adjunct professor at Osgoode Law School in Toronto, said the ruling raises questions about the supposed supremacy of the last will and testament. ‘‘To what extent will [other lawyers] take this decision and try to apply it in other circumstances. How broadly will the court take this decision and apply it in other cases?”