Just days before its series premiere, Timeless is facing an untimely copyright lawsuit in California federal court.

Spanish producer Onza Partners claims the NBC series is a ripoff of El Ministerio del Tiempo, the story of a three-person government team who travels to time to change the past, according to the complaint filed Tuesday.

Onza principal Gonzalo Sagardia met with Gersh partner Roy Ashton at an international television conference in April 2015, seeking his help in packaging an American version of the show. Sagardia gave Ashton a DVD and other promotional materials with the understanding that, if the agent liked the series, he'd facilitate the deal.

"[I]t was understood by all concerned that any persons or entities being given access by Ashton or Gersh to the Original Series DVD ... would be given such access solely for the purpose of assisting Onza in developing and exploiting Onza’s American Version," states the complaint filed by attorney Devin McRae. "While precise financial terms relative to any American Version were to be worked out among Onza and the other parties brought into the deal by Gersh, no American Version was to be made without Onza’s consent."

By July, Onza claims, Ashton had brought on Sony and writers Ben Edlund and Eric Kripke and negotiations were underway. The next month, though, news broke of the series — with no mention of Onza — and "Sony abruptly and without any warning terminated all negotiations relative to Onza’s American Version."

Onza is suing NBC, Sony, Kripke and others for copyright infringement and is also suing Sony and Kripke for breach of implied contract.

Representatives for Timeless did not immediately respond to a request for comment.