MANNHEIM, Germany (Reuters) - A German court ruled on Wednesday that Microsoft infringed Motorola Mobility's patents in making its popular Xbox gaming consoles.

Judge Holger Kircher said Microsoft breached an agreement with Motorola, which is in the process of being bought by Google, by applying certain video-compression software in products including Windows 7 and the Xbox 360 videogame console.

In the ruling, the judge ordered Microsoft to remove its popular game console as well as its Windows 7 operating system software from the German market.

The ruling followed a similar decision last week when a judge for the U.S. International Trade Commission said Microsoft infringed Motorola Mobility's patents for technology such as wireless connections for the Xbox to the Internet and video compression to speed transmission.

Technology companies have invested billions of dollars in buying up patent portfolios that they can use defensively or offensively against rivals and spent still more money litigating in the United States and Europe.

The ruling is expected to have little impact for its Microsoft's European operations as it is already moving its European software distribution centre to the Netherlands from Germany in anticipation of adverse judgments in the patent trial.

A spokeswoman for Microsoft said the outcome was "disappointing" but added the group would decide at a later stage on whether to appeal.

(Reporting by Harro ten Wolde; Editing by Greg Mahlich)