TOKYO (AP) _ Insurance companies for Boeing Co. and Japan Air Lines have agreed that the aircraft maker will pay most of the damages to the families of the 520 people killed in history's worst single-plane disaster, an official close to the negotiations said today.

The official, who spoke only on condition that he not be identified by name, said the companies had agreed that Boeing would pay about 80 percent of compensation payments.

Yoshihiko Inomata, deputy general manager of the non-marine claims department of Tokio Marine and Fire Insurance Co., JAL's insurance company, said the agreement, which the source said was reached earlier this year, was confidential and the company could not comment on the matter.

JAL spokesman Geoffrey Tudor said he also could not comment on the terms of the agreement, but that it covers ''any compensation paid to any relative,'' whether they are ''relatives who accept compensation through direct negotiations or through court action.''

Of those killed when the plane crashed into a mountain southwest of Tokyo on Aug. 12, 1985, 498 were Japanese.

The airline and the plane's maker already have paid $100 million to families that did not sue, and Boeing and JAL will split those compensation bills according to the agreed-upon ratio, Tudor said.

Last week, shortly after JAL was dropped from a lawsuit by victims' families, Boeing accepted responsibility, saying that faulty repairs it made to the 747 jet were one of the causes of the accident.

Preliminary drafts of a Japanese government report on the investigation into the accident have blamed a repair Boeing made to the 747's aft pressure bulkhead, which separates the jet's pressurized passenger compartment from the unpressurized tail section.

Investigators have suggested that a sudden rush of pressurized air from the cabin damaged vital control systems in the tail.