The Ten Commandments can go back on display as part of a historical exhibit at the Grayson County Kentucky Courthouse.
A federal appeals court ruled on Thursday that there's no evidence the county planned a religious display.
The majority opinion by Judge David W. McKeague said the county's display did not have the primary purpose of endorsing or promoting religion and was, therefore, acceptable.
The American Civil Liberties Union and two residents of the county filed the lawsuit seeking to have the Ten Commandments removed.
William E. Sharp, the ACLU attorney, said they were very disappointed with the decision.
The Ten Commandments display is part of a "Foundations of American Law and Government" exhibit. Also on display is the text of the Mayflower Compact, the Declaration of Independence and other historical documents.
Grayson County Judge-Executive Gary Logsdon said the county will continue the fight to post the Ten Commandments even if it goes to the U.S. Supreme Court.
"We're just overwhelmed and thank the Lord," Logsdon told the Lexington Herald-Leader in reaction to the decision. "It gives you great hope of a moral country."
Logsdon said his office received hundreds of telephone calls from people congratulating the county for their fight to post the Ten Commandments.
He also said the county plans a celebration on Monday to put a copy of the biblical laws back on the courthouse wall.