It was a legal battle worthy of a Federation starship taking on a Klingon destroyer.

On one side was Axanar Productions, which raised $1 million to make an amateur fan film called “Axanar” that was influenced by an episode from “Star Trek,” the popular science-fiction television series that originally was broadcast from 1966-69.

On the other side: Paramount Pictures Corporation and CBS Studios, which own the copyrights for the six “Star Trek” television series and 13 movies.

“Axanar” was the brainchild of Alec Peters of Los Angeles, an avid “Star Trek” fan. He was 8 years old when its show time moved to 10 p.m. So he could watch an episode, his mother put him to bed at 8 p.m. and woke him two hours later.

Axanar Productions made a 20-minute movie called “Prelude to Axanar” that was posted on YouTube in 2014 and was meant to be a springboard to a 90-minute movie called “Axanar.”