A judge upheld a new Florida law on Monday that was crafted to seal autopsy photos of racing legend Dale Earnhardt, rejecting arguments that it unfairly prevented access to public information.

Circuit Judge Joseph Will said the law was "valid and constitutional" in upholding the law passed by the Florida Legislature in March barring access to autopsy photos unless it is approved by a judge.

"Specifically, the court finds the legislature stated with specificity the necessity justifying the exemption of public records law," Will said.

Lawyers for the Independent Florida Alligator, a student newspaper at the University of Florida, and Websitecity.com, a DeLand-based Web site, wanted Will to toss out the law, which was adopted shortly after Earnhardt died during the Daytona 500 on Feb. 18.

The law makes it a felony to release autopsy photos without a judge's permission.

Previously, such photos had been public record.

"In enacting this law, the Legislature quite properly could not say release of these records would cause the type of harm we're talking about," Tom Julin, a lawyer for the student newspaper, had argued.

Lawyers representing the state and the Earnhardt family countered that the new law was fairly constructed.

"This statute does not deny legitimate access to anybody," said Florida Solicitor General Tom Warner.

"The (newspaper's and Web site's) argument was a constitutional shell game," said Parker Thompson, an Earnhardt lawyer.

On Tuesday, the judge will hear testimony aimed at reversing his order sealing the Earnhardt photos issued four days after the racer's last-lap accident.

Earnhardt's widow, Teresa, had sought the order, saying her family's privacy would be violated if the photos were released.

Teresa Earnhardt was expected to testify Tuesday.

In his arguments, Julin said the autopsy photos have been helpful to the public by allowing independent investigations of insurance claims, malpractice and murders.

The new law not only forbids copying of autopsy photos and records, but also prevents inspecting the records.

In the vast majority of these cases, families of the deceased don't know that a review of the records has taken place.

"There's no way that kind of action can cause that particular harm the Legislature was concerned with," Julin said.

The newspaper also contended the new law can't be applied retroactively.

Earnhardt lawyers argued in their filings that the only reason access to the photos is being sought is to grab public attention and sell newspapers.

One media outlet did get partial access to the photos.

Teresa Earnhardt and the Orlando Sentinel reached a settlement allowing an independent medical expert to view the photos and issue a report before the photos were permanently sealed.

The medical expert later determined Earnhardt's fatal injury wasn't from striking his head on a steering wheel because of a malfunctioning seat belt but that his neck snapped when his black No. 3 Chevrolet hit the wall head-on at 180 miles per hour.

The Alligator and Websitecity.com asked to intervene in the case, stating they couldn't be forced to be a part of the settlement.