Taxpayers will pay former president Ronald Reagan more than $562,000 to cover the legal expenses he racked up during an independent counsel investigation into the Iran-contra scandal, a panel of federal judges said yesterday.

Reagan's attorneys, led by Theodore B. Olson, initially asked for nearly $754,500. But the panel refused to pay the expenses Reagan incurred preparing for independent counsel Lawrence E. Walsh's final report on the investigation.

The panel, headed by Judge David B. Sentelle of the U.S. Court of Appeals for the D.C. Circuit, also balked at having taxpayers foot the bill for the time defense attorneys spent talking to reporters during the investigation.

Under the independent counsel law, government officials who are subjects of an investigation but not indicted are entitled to reimbursement for "reasonable" attorneys fees and expenses they incurred during the probe. In all, the panel said Reagan's lawyers will receive $562,111.

The three-judge panel found that Reagan was entitled to legal expenses incurred throughout the investigation, even though Walsh notified the former president in July 1992 that he was no longer a subject of the probe.

Usually, the panel refuses to order reimbursement of expenses incurred after an official is told he or she is no longer in danger of being indicted. But in Reagan's case, the panel said Walsh's rhetoric after July 1992 justifiably led Reagan to believe he was still under active investigation.

Olson said he was happy that his law firm, Gibson, Dunn & Crutcher, will finally get paid. "It's unfortunate for the subjects of independent counsel investigations that it takes so long to recover only a fraction of the fees that are actually incurred," he said. "But that is probably a subject that Congress would have to deal with, given the court's precedents in this area."

Walsh was appointed in December 1986 to investigate allegations that administration officials illegally sold arms to Iran and used the proceeds to fund the contras' battle against the Nicaraguan government, in violation of the Boland Amendments. The amendments prohibited the United States from spending money to help overthrow the government of Nicaragua. Walsh issued his final report in January 1994.