Creators of popular movies, TV shows, books, and video games are sometimes savvy enough to register unique characters and fictional places with the U.S. Patent & Trademark Office, but a federal court ruling in a case involving SpongeBob Squarepants shows that a fictional business need not be trademarked in order to benefit from trademark protection.

In Nov. 2015, Viacom — the company behind the animated Mr. Squarepants — learned that a Texas company called IJR Capital Investments had applied to trademark the name “Krusty Krab” in advance of its plans to open a restaurant under that brand.

For those not familiar with SpongeBob, Krusty Krab is a restaurant that is regularly featured on the show. Viacom sued IJR in Jan. 2016 after the company refused to halt its trademark application or stop its plans to use the Krusty name.

The Viacom complaint [PDF] features what are maybe the two most hilariously accurate paragraphs ever included in a federal lawsuit:

“The ‘Krusty Krab’ is owned by Eugene H. Krabs, a prominent and recurring character in the SpongeBob universe. SpongeBob SquarePants works at the ‘Krusty Krab’ as a fry cook, but he also performs a myriad of other duties, and once stated that his official title is ‘Vice Assistant General Manager in charge of certain things.’ The ‘Krusty Krab’ is the scene of many comical exchanges between SpongeBob and his co-worker, Squidward Tentacles. SpongeBob loves his job and considers Squidward a close friend; Squiward hates his job and does not like SpongeBob.

“‘Krusty Krab’’s chief competitor is the ‘Chum Bucket,’ which is owned by Sheldon J. Plankton, Mr. Krabs’ worst enemy. The ‘Krusty Krab’ maintains an advantage over the “Chum Bucket” based upon the popularity of its ‘Krabby Patty’ burger.”

Viacom argued that even though it had never separately registered a Krusty Krab trademark, the name was so closely associated with the SpongeBob brand that it had repeatedly been used in officially licensed toys, merchandise, apparel and in other media, like the book Jokes from the Krusty Krab. Additionally, Viacom had successfully registered the mark for “Krabby Patties,” the fictional restaurant’s signature dish.

And this week, U.S. District Court Judge Gray Miller sided with Viacom [PDF], granting summary judgment in favor of the media company, noting that “ownership of a mark is established by use in the market, not by registration.”

In other words, since Viacom was the first to use “Krusty Krab” for commercial purposes, it is entitled to try to prevent others from using the term.

IJR had argued that Viacom couldn’t claim a trademark right in the name of a fictional restaurant, but Judge Miller was having none of that pointing to court rulings in favor of made-up terms and businesses like “Kryptonite” and the “Daily Planet” newspaper from the Superman fictional universe.

Additionally, Viacom’s use of the term “Krusty Krab” was so distinctive as to merit trademark protection.

The question then is whether a reasonable consumer would associate a Krusty Krab restaurant with the animated eatery.

“Context here is critical,” notes Judge Miller, noting that both uses of the contested Krusty Krab name involve restaurants. Even if one of them currently exists only in a cartoon, the judge points out that there real-world restaurants that got their start in fiction.

He gives the example of Bubba Gump Shrimp Co. The seafood chain isn’t just inspired by characters and events in Forrest Gump, the brand is officially licensed from Paramount, which just happens to be a Viacom subsidiary.

IJR also claimed that there would be little to no overlap of the two marks because their Krusty Krab restaurant would be marketed to adults. Viacom countered that a full third of its audience is over the age of 18.

In a statement to the WSJ Law blog, IJR says it has plans to appeal this ruling, stating a belief that “it was a biased decision on the part of the judge.”