LOS ANGELES — A jury on Monday found that Katy Perry's 2013 hit "Dark Horse" improperly copied a 2009 Christian rap song, setting up arguments over how much the singer and other defendants will owe.

Monday's decision returned by a nine-member federal jury in a Los Angeles courtroom came five years after Marcus Gray and two co-authors first sued alleging "Dark Horse" stole from "Joyful Noise," a song Gray released under the stage name Flame.

The case now goes to a penalty phase, where the jury will decide how much the plaintiffs are owed for copyright infringement.

Gray's attorneys argued that the beat and instrumental line featured through nearly half of "Dark Horse" are substantially similar to those of "Joyful Noise."

"Dark Horse," a hybrid of pop, trap and hip-hop sounds that was the third single of Perry's 2013 album "Prism," spent four weeks atop the Billboard Hot 100 in early 2014, and earned Perry a Grammy nomination.

Perry's attorneys argued that the song sections in question represent the kind of simple musical elements that if found to be subject to copyright would hurt music and all songwriters.

"They're trying to own basic building blocks of music, the alphabet of music that should be available to everyone," Perry's lawyer Christine Lepera said during closing arguments Thursday.

Perry and the song's co-authors, including her producer Dr. Luke, testified during the seven-day trial that none of them had heard the song or heard of Gray before the lawsuit, nor did they listen to Christian music.

Gray's attorneys had only to demonstrate, however, that "Joyful Noise" had wide dissemination and could have been heard by Perry and her co-authors, and provide as evidence that it had millions of plays on YouTube and Spotify, and that the album it's included on was nominated for a Grammy.

"They're trying to shove Mr. Gray into some gospel music alleyway that no one ever visits," said plaintiffs' attorney Michael A. Kahn during closing arguments, when he also pointed out that Perry had begun her career as a Christian artist.

Kahn and Gray declined comment but smiled as they left the courtroom after the verdict.

The 34-year-old pop superstar and "American Idol" judge brought laughs to the proceedings when she testified during its second day, and her lawyers were having technical troubles getting "Dark Horse" to play in the courtroom.

"I could perform it live," Perry said.

No performance was necessary after the audio issues were fixed. Jurors heard both songs played back-to-back in their entirety at the end of closing arguments this week.

Perry was not present for the reading of the verdict Monday afternoon.