TOKYO — A Japanese court on Tuesday ordered the government and the operator of the Fukushima nuclear plant to pay $4.5 million to thousands of area residents and evacuees who were demanding compensation for their livelihoods lost in the 2011 nuclear crisis.

The Fukushima District Court said the government had failed to order Tokyo Electric Power Co. to improve safety measures despite knowing as early as 2002 of a risk of a massive tsunami in the region.

The 3,800 plaintiffs, who sued in 2015, form the largest group among about 30 similar lawsuits involving 12,000 people pending across Japan.

Closely monitored as a measure of government responsibility, Tuesday’s ruling was the second verdict that held the government accountable in the Fukushima meltdowns, increasing hopes for other pending cases.

The court upheld the plaintiffs’ argument that the disaster could have been prevented if the economy and industry ministry had ordered TEPCO to move emergency diesel generators from the basement to higher ground and make the reactor buildings water-tight based on 2002 data that suggested there was a risk of a tsunami as high as 15.7 meters (51 feet).

The court also upheld arguments by the plaintiffs that TEPCO ignored another chance to take safety measures when a government study group warned in 2008 of a major tsunami triggering a power outage at the plant.

The tsunami that swept into the plant on March 11, 2011, knocked out the reactors’ cooling system and destroyed the backup generators that could have kept it running and kept the nuclear fuel stable.

The government and the utility have argued that a tsunami as high as what occurred could not have been anticipated and that the accident was unavoidable.

Nuclear Regulation Authority spokesman Kazuhiro Okuma told reporters that the authority plans to discuss whether to appeal the ruling with other government agencies. He said the regulatory authority is determined to fulfill its duty to strictly examine reactor safety under the new standard based on the lessons learned from the Fukushima accident.

Investigation reports by the government, parliament and private groups have blamed the disaster on TEPCO’s lack of safety culture, as well as collusion between the utility and government regulators that had allowed lax oversight. After the accident, the more independent regulatory system and a stricter safety standard were established.

Tuesday’s ruling dismissed the plaintiffs’ demand that radiation levels in their former neighborhoods be reduced to pre-disaster levels.

TEPCO is still struggling with the plant’s decommissioning, which is expected to take decades.

The ruling followed a decision in March by the Maebashi District Court, which ordered the government and TEPCO to split the 38 million yen ($336,000) compensation to 62 former Fukushima residents in addition to the compensation TEPCO had already paid them. Another ruling last month, however, said only TEPCO should pay 376 million yen ($3.4 million) to nearly 45 former Fukushima residents.