Tom Petty given songwriting royalties for Sam Smith's "Stay With Me"

Sam Smith performs onstage during iHeartRadio Jingle Ball 2014 at Madison Square Garden on Dec. 12, 2014, in New York.

Kevin Kane/Getty Images for iHeartMedia

Sam Smith now has to share a portion of royalties from his hit song "Stay With Me" with Tom Petty and Jeff Lynne of Electric Light Orchestra fame.

Smith's rep confirmed to Rolling Stone that the British singer settled a lawsuit out of court last fall involving the likeness of the Grammy-nominated "Stay With Me" and "I Won't Back Down" from Petty's 1989 album "Full Moon Fever." Smith is now giving 12.5 percent of the royalties from the ballad to Lynne and Petty.

"Recently the publishers for the song 'I Won't Back Down,' written by Tom Petty and Jeff Lynne, contacted the publishers for 'Stay With Me,' written by Sam Smith, James Napier and William Phillips, about similarities heard in the melodies of the choruses of the two compositions," Smith's rep told Rolling Stone. "Not previously familiar with the 1989 Petty/Lynne song, the writers of 'Stay With Me' listened to 'I Won't Back Down' and acknowledged the similarity."

The rep said that "although the likeness was a complete coincidence, all involved came to an immediate and amicable agreement" on the matter.

"Stay With Me" appears on Smith's debut album, "In the Lonely Hour." It's up for both best pop solo performance and record of the year at the 2015 Grammys. Smith will also perform at the show.

Petty's "Full Moon Fever" also featured the singles "A Face in the Crowd," "Free Fallin'" and "Runnin' Down a Dream."

Listen to both songs below and let us know if you hear the similarities in the comments section below: