"The Da Vinci Code" author Dan Brown and his publishing house were cleared of copyright infringement in a British court Friday, with the judge finding the lawsuit based on a contrived and "selective number of facts and ideas."

Authors Michael Baigent and Richard Leigh had sued Random House, claiming Brown's best-selling novel "appropriated the architecture" of their 1982 nonfiction book, "The Holy Blood and the Holy Grail."

"It would be quite wrong if fictional writers were to have their writings pored over in the way DVC (`Da Vinci Code') has been pored over in this case by authors of pretend historical books to make an allegation of infringement of copyright," Judge Peter Smith said in his 71-page ruling.

Both books explore theories that Jesus married Mary Magdalene, the couple had a child and the bloodline survives, ideas dismissed by most historians and theologians.

"The Da Vinci Code" has sold more than 40 million copies -- including 12 million hardcovers in the United States -- since its release in March 2003. It came out in paperback in the United States last week, and quickly sold more than 500,000 copies. An initial print run of 5 million has already been raised to 6 million.

Those sales should go even higher with the planned May 19 release of a film version starring Tom Hanks.

The decision was lauded by Brown, Random House and those who believed the case was a test for fiction authors wanting to use the research of others in their work.

"Cases like this hopefully will clarify what copyright is all about," said Allan Adler, vice president for legal and government affairs at the Association of American Publishers.

"Copyright doesn't protect ideas and copyright doesn't protect facts. That's why we have genres, fiction and nonfiction, and a number of people can write novels based on the same idea and still have freedom of expression."

Brown, who testified for a few days and then returned to his home in New Hampshire, said in a statement that a novelist must "be free to draw appropriately from historical works without fear that he'll be sued and forced to stand in a courtroom that call into question his very integrity as a person."

The case proved a distraction for Brown, who dislikes publicity and has been trying to complete a much-anticipated follow-up to "The Da Vinci Code," and a costly embarrassment for Baigent and Leigh. They spent two years on the lawsuit and nearly $3.5 million, between their own legal expenses, and Random House's fees. Though Smith ruled against allowing the authors to appeal, they can still apply to higher courts.

No decision on an appeal has been made, Leigh said.

The authors must also find an interim payment of $600,000 by May 5. In court, their lawyer said at least one of the claimants will have to sell their home to make the first installment. When Leigh was asked if his house would be going on the market, he smiled and said wryly, "what house?"

Random House may end up the biggest winner. Its legal costs are covered and, as publisher of "The Da Vinci Code" and "The Holy Blood and the Holy Grail," it benefits from increasing sales for both books.

After the ruling, Leigh lit up a cigarette at his lawyers' office -- "I'm more eloquent when I smoke," he said -- and announced that he and his co-author never intended for the case to have an impact on artistic freedom.

"I would simply want the interpretation of that material to be their own," he said. "If it is not their own, I would like it to be acknowledged."

Brown said in his statement that he was "still astonished that these two authors chose to file their suit at all." But he did have kind words for the courthouse itself, hinting fans someday will read more about it.

"I found the London High Court building to be a magnificent example of neo-Gothic architecture," wrote Brown, who set "The Da Vinci Code" in Europe. "I look forward to returning soon to view it from a vantage point other than the witness stand."