A Dallas jury ruled Wednesday against Facebook in a copyright infringement lawsuit brought over virtual reality technology, awarding a rival company $500 million.

The case hinged on whether video game developer ZeniMax Media or Facebook owned the technology behind the Oculus Rift, a ground-breaking virtual reality headset.

Facebook bought virtual reality startup Oculus for $2 billion in 2014 and said it put billions more into developing the Oculus Rift.

But ZeniMax claimed that John Carmack, the creator of popular video games Doom and Quake, developed the underpinnings of the virtual reality technology while working for id Software, a Richardson-based company owned by ZeniMax Media.

ZeniMax's attorneys said before leaving his job at id Software to work for Oculus, Carmack played an instrumental role in the creation of the headset by corresponding with Palmer Luckey, who Oculus says was the brains behind its prototype.

In its verdict, the jury rejected claims that Oculus stole trade secrets, but it found that Oculus -- and its co-founders, Luckey and Brendan Iribe, infringed upon some of ZeniMax's or id Software's copyrights.

The jury ordered Oculus to pay $200 million for violating a non-disclosure agreement, $50 million for copyright infringement and $50 million for improper use of ZeniMax's trademarks. Iribe and Luckey were ordered to pay $150 million and $50 million in damages for trademark misuse.

ZeniMax had sought as much as $6 billion in damages

The lawsuit brought big tech names to Dallas, most notably Facebook CEO and co-founder Mark Zuckerberg. He testified two weeks ago at the Dallas federal courthouse. Facebook has faced other lawsuits, but Zuckerberg said during his testimony that he'd never taken the stand in a courtroom.

ZeniMax said in a statement that it will take measures to "ensure there will be no ongoing use of our misappropriated technology." That may include seeking an injunction to keep Oculus and Facebook from using computer code, it said.

"While we regret we had to litigate in order to vindicate our rights, it was necessary to take a stand against companies that engage in illegal activity in their desire to get control of new, valuable technology," the company said in a statement.

An Oculus spokeswoman said the company will file an appeal.

"The heart of this case was about whether Oculus stole ZeniMax's trade secrets, and the jury found decisively in our favor," the company said in a statement. "We're obviously disappointed by a few other aspects of today's verdict, but we are undeterred. Oculus products are built with Oculus technology."

In his testimony, Zuckerberg said he saw virtual reality's promise as the next major computing platform. He spoke about the immersive experiences that virtual reality can bring to life, such as re-living a child's first steps or playing ping-pong with a friend or family member who's across the world.

ZeniMax's attorney criticized the quick timetable of the $2 billion deal, saying Facebook did not do its due diligence.

But Zuckerberg rejected that, saying Facebook developed a relationship with Oculus over time and had to move fast to prevent a competing bid. He said it's common for people to "come out of the woodwork" when doing a big deal.

The verdict came the same day that Facebook reported fourth-quarter earnings, which beat Wall Street expectations and dwarfed the amount of the jury award. Facebook's revenue grew by about 53 percent since the same time last year to $8.63 billion.

Read the full verdict: