Teva Pharmaceutical (Nasdaq: TEVA) investors got a welcome surprise on Friday when a court ordered the FDA to award the company a 180-day exclusive selling period for its generic version of Johnson & Johnson's (NYSE: JNJ) Risperdal tablets.

Teva had sued for the exclusivity period because it filed its Abbreviated New Drug Application with the FDA, claiming that a Johnson & Johnson patent was invalid. The agency apparently agreed with Teva, because it removed the patent from its book of patents, but never awarded Teva the exclusivity period.

According to IMS Health data cited by Teva, Risperdal had U.S. sales of about $2.5 billion last year. If Teva can capture just 25% of the market and price the drug at 90% of Johnson & Johnson's price, it'll bring in more than $230 million during its six months of exclusive sales. Not a bad boost for a company that raked in $9.4 billion in revenue last year, especially considering that its generic Risperdal will fetch much higher gross margins than its drugs that have competition.

Ironically, the court's decision could actually help Johnson & Johnson. The drugmaker might see fewer patients switching to generics, since there will be only one high-priced generic on the market. Mylan (NYSE: MYL), Par Pharmaceutical (NYSE: PRX), and Barr Labs (NYSE: BRL), among others, already have tentative FDA approval to market their liquid and tablet version of the drug.

I wouldn't be shocked if the FDA appealed the decision. The agency turned down Teva's Citizen's petition to reinstate the patent, which started the legal battle, so the agency clearly thinks it had the right not to award the exclusivity period. The most recent legal battle took about a month to sort out, so an appeal might be decided before Risperdal goes off patent in June.

It's hard to tell how this one will eventually end up, but the most recent decision should give investors confidence in Teva's legal team -- a nice thing to have in an industry where companies live and die by their court decisions.