Five drug companies and Japan's Minister of Health and Welfare agreed today to a proposed settlement with hemophiliacs who were infected with the AIDS virus through contaminated blood-clotting products, setting the stage for the end of seven years of bitter litigation.

The case has roiled Japan because it seemed to show that the Government was more interested in shielding Japanese drug companies from foreign competition than in protecting public health.

The settlement, which was recommended by courts presiding over the lawsuits in Tokyo and Osaka, would grant each plaintiff a lump-sum payment of 45 million yen, or about $430,000. Any plaintiff who develops AIDS will also receive a monthly payment of about $1,400. The Government, which is expected to formally accept the settlement on Friday, will pay 44 percent of the costs and the pharmaceutical companies 56 percent. The hemophiliacs and their families are expected to agree to the settlement soon.

Today, several top executives of the Green Cross Corporation, one of the drug manufacturers, knelt on the floor in apology to a delegation of victims at the company's Osaka headquarters. As the mother of one victim loudly berated them, the executives bowed until their heads touched the ground.