A U.S. federal court has ordered Microsoft Corp to stop selling some versions of its widely used Word software in the United States in two months, ruling in favor of a small Canadian firm that accused the software giant of violating its patents.

A U.S. district court in Texas ruled in favor of i4i Ltd in its long-running patent dispute against Microsoft, slapping more than $290 million in damages on Microsoft and issuing an injunction preventing the world's top software company from selling versions of Word that contain the disputed patent technology.

The patent in question relates to the use of XML, or extensible markup language, in the 2003 and 2007 versions of Word.

The injunction, set to take effect in 60 days, is not expected to hurt Microsoft. The software giant could easily adjust its programs to comply with the court's ruling, according to industry experts, or settle with i4i.

And a new version of Word -- which does not include the disputed patent technology -- goes on sale next year with the release of Office 2010, potentially side-stepping the issue.

Shares of Microsoft ended Wednesday up 2 percent and inched up another 0.3 percent in after-hours trade.

Microsoft, which is involved in a number of legal battles over patents, said it plans to appeal the verdict.

We believe the evidence clearly demonstrated that we do not infringe, and that the i4i patent is invalid, Microsoft spokesman Kevin Kutz said.

CASH COW

Word is Microsoft's core word-processing application in its flagship Office suite of business software, used worldwide and long the U.S. software developer's reliable cash cow.

The patent in question is for the use of XML, technology used to make documents such as corporate earnings reports and news articles machine-readable and easily publishable on multiple platforms.

Toronto-based i4i had claimed in a 2007 suit that Microsoft knowingly infringed one of its patents in its Word application and its Vista operating system.

The final judgment from the U.S. District Court ruled that Microsoft did infringe on i4i's patents, following a jury verdict issued in favor of i4i on May 20.

The case is i4i Limited Partnership and Infrastructures for Information Inc vs Microsoft Corp, U.S. District Court, Eastern District of Texas, Tyler Division, No. 6:07CV113.

(Additional reporting by Saumyadeb Chakrabarty in Bangalore and Bill Rigby in Seattle; Editing by Edwin Chan and Bernard Orr)