BOISE, Idaho — A San Francisco-based federal appeals court ruled in 2002 that every aspect of an execution should be open to witnesses, from the moment the condemned enters into the death chamber to his final heartbeat.

The ruling established what was expected of the nine Western states within the court's jurisdiction. A decade later, five of the states have kept part of each execution away from public view, according to an Associated Press review and death penalty experts.

Idaho, Arizona, Washington, Montana and Nevada have conducted 15 lethal injections since the ruling, and half of each procedure has been behind closed doors.

That means that a small group of witnesses, including members of news organizations who act as representatives of the public, do not see, for instance, the insertion of the IVs that deliver the fatal drug mixture.

The practice comes at a time when the method itself has drawn greater scrutiny, from whether the drugs are effective to whether the execution personnel are properly trained.

The states that limit access say they do so to protect the anonymity of the execution team, which may include emergency medical technicians, military medics or others trained to insert IVs. Open government and journalism groups argue that witnessing all aspects of an execution is the only way to determine if it is being properly carried out.

The AP and 16 other organizations on Tuesday sued the state of Idaho to force officials to open the entirety of their executions, arguing that the news media and by extension the public has a First Amendment right to view all steps of lethal injections.

"This lawsuit is really all about obtaining access to the entire execution process for viewing purposes," said Chuck Brown, the attorney representing the news organizations. "It's very important in a society such as ours to have full transparency in regards to the exercise of government authority."

Idaho Department of Correction spokesman Jeff Ray said late Tuesday the department had not yet had a chance to review the lawsuit, and that the state's attorneys would respond to the claims in court.

Several high-profile cases since 2006 have raised questions about the way states conduct lethal injections.

In two instances in Ohio, one of the few states that allow witnesses to see the entire process, corrections staff couldn't find a vein. In one of those cases, officials halted the execution and the inmate remains on death row. With news organizations present, the experiences of the inmate, Romell Broom, were widely reported.

In another case, in Florida in 2006, which does not allow viewing of the IV insertions, executioners pushed the needles through Angel Nieves Diaz's target veins and into the soft tissue beneath. He had to be given a second dose and took 34 minutes to die — more than twice the normal time.

Historically, the public was able to watch executions from start to finish, said Trina Seitz, a death penalty expert at Appalachian State University.

Over time, executions became more private as technology advanced. Electrocutions, for example, can't be done in a rainy prison yard for safety reasons, so they were moved inside, said Stuart Banner, a legal historian at UCLA's School of Law.

Still, journalists have always been reserved a spot among the witnesses, Seitz said, so they could report the death back to the public.

In the 1990s, several news organizations attempted to get on the witness list for the lethal injection of William Bonin in California. Bonin was dubbed the "Freeway Killer" for the serial murders of 14 young men and boys.

Those who did witness the execution were unsure about what they saw.

Bonin was already strapped to a gurney with IV tubes attached when the death chamber's curtains were drawn open. He barely moved, and his eyes were closed. A few silent minutes passed, and then he was pronounced dead.

The California First Amendment Coalition sued, saying the limited access violated the public's first amendment rights to view executions. California officials argued the restriction was necessary to preserve the execution team's anonymity.

In 2002, the 9th U.S. Circuit Court of Appeals rejected that argument, saying there were other ways to protect their identity. Execution team members could wear surgical masks, hats and gloves, the court noted.

"Independent public scrutiny — made possible by the public and media witnesses to an execution — plays a significant role in the proper functioning of capital punishment," the judges ruled.

The ruling applies to a region that stretches from Montana to Hawaii and Alaska. Alaska, Hawaii, Guam and the Northern Mariana Islands do not have the death penalty, and Oregon currently has a moratorium on executions. Only California has followed the ruling.

Outside the region, there are 27 states that use lethal injection. Ohio changed its rules in 2004 after the American Civil Liberties Union threatened to sue. For 25 years, Georgia has allowed a reporter to act as a "monitor" during the process, while other witnesses enter the viewing chamber later.

In Idaho, when made aware of the 2002 court ruling, state officials said the decision did not apply to their procedures. "The circumstances of the case are unique to California," said Idaho deputy attorney general for prisons, Mark Kubinski. But Kubinski, other state attorneys, the governor's office and corrections officials have refused to say exactly why.

Kubinski said the protocol balances the public's right to witness executions with the state's obligation to carry it out "in a safe and professional manner, while maintaining respect and dignity for all parties."

During Idaho's most recent execution, Paul Ezra Rhoades, who was convicted of killing three people in 1987, could not be seen as he was brought into the death chamber. When the curtains were drawn, IVs were already connected.

When asked by a reporter about what happened before the curtains were opened, the corrections director, Brent Reinke, said the procedure was somber and professional and described how the IVs and other equipment was inserted.

Rhoades' attorneys had sued in federal court, arguing that Idaho's death penalty protocol created the opportunity for several excruciating errors. Of most concern was incorrect IV placement, which could leave him paralyzed but conscious.

The legal scholars contacted by the AP who reviewed the California court case said it would be difficult to find a ruling that applies more closely to Idaho's policies.

Jen Moreno, a staff attorney with the Death Penalty Clinic at the University of California's Berkeley Law, said the ruling sets precedent for all states within the 9th Circuit and that the non-complying states would likely be forced to change their policies if they were challenged in federal court.

Moreno said the process of setting the IVs is the most crucial part of lethal injection because, if it is done incorrectly, the rest of the execution can go awry.

"The fact that the states are hiding one of the most important parts of the execution, setting the IV, really means that what the public does see is not going to be very telling of whether it was a humane execution," she said.