Japan agreed Monday to ease the country's ban on U.S. and Canadian beef imports, resolving a bitter trans-Pacific trade dispute two years after the first case of mad cow disease was discovered in the U.S. herd.

The easing of the ban would allow meat from cows under 21 months old back into the Japanese market, which before the ban had been the most lucrative overseas market for American beef, buying $1.7 billion worth in 2003.

It was not immediately clear when U.S. meat would again appear in Japanese supermarkets and restaurants, but Kyodo News agency reported that approval could allow North American meat back in Japan by the end of the year.

The decision was formally adopted Monday by Japan's agriculture and health ministries, officials said. It follows a recommendation from the country's Food Safety Commission last week to resume limited imports.

Surveys show Japanese are as leery as ever of U.S. beef and unwilling to buy it, while American ranchers say a series of new safety requirements imposed by Tokyo could keep many producers from tapping the market anyway.

The new rules would allow only meat from cows younger than 21 months, because no cases of mad cow disease have been found in cows that age. Besides requiring U.S. producers to certify the cow's age, the new rules also demand that U.S. inspectors follow strict guidelines, such as removing dangerous cow material such as brains and spinal cords.

While the United States has had two cases of mad cow disease, Japan has reported 21 since its first in 2001.

Japan's latest was confirmed over the weekend, when Japan's agriculture ministry determined that a cow that died last week also had the sickness, also known as bovine spongiform encephalopathy, Kyodo News agency reported.

A survey last week by Kyodo showed some 75 percent of Japanese are unwilling to eat U.S. beef because of mad cow fears, compared to 21.2 percent who said they would consume it. Most worry about the reliability of U.S. inspection measures.

Eating beef from cattle infected with mad cow disease can cause a fatal brain disorder in humans.

American ranchers are meanwhile daunted by the extra expense of breaking back into the market.

Selling beef to Japan will generally mean keeping a paper trail from the ranch to the feedlot to the slaughterhouse, to verify cattle are killed at 20 months of age or younger. But birth records alone will not do, and in many cases, producers will need third-party verification of their documents and herds for corroboration, according to beef experts at Iowa State University.

Although Japan has reported more cases of mad cow disease than the United States, the difference is that Japan tests every domestic cow that goes to the slaughter house, and it initially demanded that the United States do the same before resuming trade.

U.S. authorities balked at the cost of testing the huge American herd and argued that it was not scientifically necessary. Japan estimates that under the eased guidelines, some 5 million American cows could be proven eligible for export.

After protracted negotiations, both sides finally settled on allowing cows younger than 21 months.

The 2003 discovery of mad cow in the United States, the first of two, prompted dozens of countries to ban U.S. beef; at least 70 countries have since lifted their bans, at least partially, according to the chief economist of the National Cattlemen's Beef Association.