CBS and Paramount Pictures have reached a settlement with the producer of an unauthorized "Star Trek" fan film a little more than week before the copyright-infringement lawsuit was set to go to trial.

RELATED: "Star Trek: Axanar" Producers Fire Back at "Draconian" Fan Film Guidelines

The "Star Trek" rights holders issued a joint statement today with Axanar Productions that announced a resolution to the dispute, with Alec Peters and Axanar acknowledging that their "Prelude to Axanar" short film and planned "Star Trek: Axanar" feature "were not approved by Paramount or CBS, and that both works crossed boundaries acceptable to CBS and Paramount relating to copyright law."

Paramount and CBS, which control the film and television rights to “Star Trek,” sued the producers of “Axanar” in December 2015, seeking to block the release of the fan-made prequel, which had raised $1.3 million in crowdfunding. The action was immediately divisive, as “Star Trek” fan works had been long been tolerated by the rights holders, with the controversy drawing in “Star Trek Beyond” director Justin Lin and producer J.J. Abrams. Although Abrams announced in May that Paramount would drop the lawsuit, that didn't happen.

The dispute led CBS and Paramount to issue guidelines for producing “Star Trek” fan films, which greatly restrict run times and number of segments, and prohibit additional seasons, episodes or sequels. The guidelines, which the producers of “Axanar” criticized as “draconian,” also dictate that fan productions may not be remakes of “Star Trek” films or episodes, must not use bootlegs or imitations of commercially available uniforms or props, and cannot use any writers or actors who have previously been employed on a “Star Trek” series or movie.

RELATED: "Star Trek" Fan Film Still Pending, Despite Talk of Settlement

According to the joint statement, when "Axanar" is finally released, it will adhere to those guidelines for fan films: "Axanar and Mr. Peters have agreed to make substantial changes to 'Axanar' to resolve this litigation, and have also assured the copyright holders that any future 'Star Trek' fan films produced by Axanar or Mr. Peters will be in accordance with the 'Guidelines for Fan Films' distributed by CBS and Paramount in June 2016."

Set 21 years before the second pilot of the classic “Star Trek” series, “Axanar” focuses on legendary Starfleet captain Garth of Izar and his crew during the Four Years War between the Klingon Empire and the Federation.

Peters was dealt a legal blow earlier this month when a federal judge ruled he couldn't argue "fair use" in his defense of "Axanar," because the film has “objective substantial similarity” to "Star Trek." U.S. District Court Judge R. Gary Klausner pointed to the fan film's use of Garth, Klingon and Federation starships, the Vulcan council and the teachings of Vulcan philosopher Surak to support his conclusion that “Axanar” is objectively similar to the original “Star Trek.”

Klausner determined that it was up to a jury to conclude whether an ordinary, reasonable person would also find those elements and others are subjectively similar. The trial as scheduled to begin on Jan. 31.

(via The Hollywood Reporter)