The decision, which backs a petition from residents living near the Takahama atomic station west of Tokyo, means Kansai Electric must go to a higher court to try and win permission to get the reactors back online
The move marks the latest judicial impediment to utilities' attempts to restore atomic power after the Fukushima disaster five years ago. Two out of Japan's 42 operable reactors are running, but a local governor who won election on Sunday has vowed to shut those units down.
While Prime Minister Shinzo Abe's government is keen to restore a power source that provided about a third of electricity supply before the meltdowns at Fukushima, the public remains deeply sceptical over industry assurances on safety.
Residents have lodged injunctions against nearby nuclear plants across Japan and lower courts have been increasingly siding with them on safety concerns.
Contentious verdicts are usually overturned by higher courts, where judges tend to be more attuned to government policy, judicial experts say.
But with courts and local politicians providing obstacles there may be further impetus for the government to scale back nuclear targets. Japan will cut the emphasis on nuclear in its next energy plan, sources told Reuters in May.
The government has boosted renewable energy output and the population has responded to requests for more energy efficiency. The government is also strongly pushing for higher use of coal, which has soared to record levels.
Japanese utilities have benefited from a plunge in oil and gas prices that have kept costs down after higher imports of fossil fuels helped drive Japan into a record trade deficit in the years after Fukushima.
The Otsu District Court on March 9 ordered Kansai Electric, Japan's second-biggest utility, to shut down the Takahama reactors in the country's first injunction to halt an operating nuclear plant.
"Today's decision ... is very regrettable and we cannot accept it," Kansai Electric said in a statement, adding that it would file an appeal with the Osaka High Court.
An appeal may take about a year and means continued extra purchases of oil, gas or coal to replace nuclear power generation.
A Kansai Electric spokesman said the shutdown of the two Takahama reactors reduces recurring profit by 10 billion yen ($97 million) per month because of higher fossil fuel use and other factors.
Shares in Kansai Electric had ended trading before the court decision. They closed 0.5 percent higher at 977.1 yen, while the broader market rose over 2 percent.
Track Latest News Live on NDTV.com and get news updates from India and around the world