A Missouri judge has ruled that the state must reveal the source of the drug it uses to execute prisoners.

Cole County Circuit Judge Jon Beetem's ruling late Monday won't take effect until appeals are exhausted. Missouri Attorney General Chris Koster's spokeswoman says the ruling is under review and declined to say whether there would be an appeal.

Missouri has declined for several years to say where it obtains the execution drug pentobarbital. The state has claimed the source could be withheld under an exemption to the Missouri Sunshine Law.

The lawsuit was filed by media organizations that included The Associated Press, Kansas City Star and St. Louis Post-Dispatch. A lawyer for the media organizations says he hopes the ruling ends litigation costing taxpayers tens of thousands of dollars.