A federal judge has temporarily blocked a controversial plan by the Interior Department that would surgically sterilize wild horses in Oregon after animal rights groups filed a lawsuit.

U.S. District Court Judge Michael W. Mosman issued a preliminary injunction on Friday that stops the Bureau of Land Management from moving forward with its plan to surgically remove the ovaries of wild mares in the Warm Springs Management Area of Hines, Oregon, according to court records.

“We thank the court for preventing the BLM from proceeding with a reckless and inhumane surgical sterilization experiment that would endanger the welfare and lives of federally protected wild horses,” Joanna Grossman, equine program manager for the Animal Welfare Institute, said in a statement.

"Today’s ruling is a decisive victory for animal welfare and for the American people, who not only cherish wild horses but have a First Amendment right to understand how the federal government is treating and managing these herds on public lands," Grossman added.

The judge's decision means the agency cannot proceed with the experiment until a final decision is made in the case. No date has been set for that yet.

Sign up for Breaking News Alerts from NBC News

The Animal Welfare Institute, American Wild Horse Campaign, The Cloud Foundation and other animal welfare groups had sued in September, claiming the government project was in violation of the First Amendment for not letting groups observe and document the experiment while also being in violation of a number of laws including the Wild Free-Roaming Horses and Burros Act, National Environmental Policy Act and the Administrative Procedure Act.

A Bureau of Land Management spokesperson said Tuesday that they cannot comment on pending litigation.

The bureau has struggled with managing herd populations and in 2016 issued a report to Congress saying since receiving federal protection in 1971, “wild horse and burro populations on public lands have dramatically increased, far exceeding what is healthy for the land and the animals.”

In June, the bureau put forward a proposal aimed at herd size management, saying it was seeking to evaluate the safety, complication rate and feasibility of using the sterilization surgery, called an ovariectmony via colpotomy, on wild horse mares in conjunction with Colorado State University.The experiment was looking to assess the impacts of the procedure on those horses and their behavior compared to horses without the surgery.

The study would look at 200 horses from the Warm Springs Herd Management Area, in southeastern Oregon, with 100 horses receiving the procedures and 100 serving as a control for the experiment, according to the proposal.

In August, following a public comment period, CSU withdrew from the project, but the bureau decided to move forward with its plan anyway, according to the bureau’s website. The bureau issued its final assessment on the proposal in September.

Grossman told NBC News on Monday that the decision to “move forward regardless without an academic institution to provide expertise on equine welfare” greatly raised concerns for animal rights groups.

With the university out of the picture, the bureau was going to greatly restrict “public access to monitor, observe and document the mares as they were going through this procedure,” she added.

The animal welfare groups then decided to file suit claiming the experiment violates their First Amendment rights as well as the environmental laws, Grossman said.

The surgical procedure involves a veterinarian removing both of a mare's ovaries by making an incision and putting their hand inside the horse’s abdominal cavity and “looking for the ovaries blindly” and then severing them using a tool, she said.

That surgery can result in complications, trauma and even death for the mares especially once they’re returned to the wild and not having follow up treatment, she said.

The animal welfare group believes such a procedure is “widely viewed as being out of date” and inhumane and that there are other methods that can help successfully control populations without being so invasive, she said.

Grossman added that the surgical procedure “was not common at all” for wild mares and in domesticated horses would usually only be performed if the mare needed it for medical reasons, such as to remove a malignant growth.

Grossman said she and other animal rights groups have been advocating for immunocontraceptive vaccines or pellets that prevent the horses from being fertile as more humane.

"It’s a far more humane way of managing wild horse populations that doesn’t involve a risky invasive surgery that puts the lives of these animals on the line," she said.