It was the first court ruling in Japan against the restarting of reactors since a massive earthquake and tsunami sparked meltdowns at the Fukushima nuclear plant in March 2011.
At present, all of Japan's nearly 50 nuclear reactors are offline due to shutdowns or safety checks.
The regional court at Fukui in western Japan said the two reactors at the Oi plant operated by Kansai Electric Power Co should not be restarted after safety checks because they pose "specific risks" to residents in the event of a major earthquake.
The power utility said it would appeal the ruling.
More From This Section
In the face of widespread public unease about nuclear power, the Nuclear Regulation Authority in July last year introduced new safety standards. These oblige plant operators to put in place specific countermeasures against serious accidents like meltdowns or tsunamis.
The government of Prime Minister Shinzo Abe said there was "no change at all" in its plan to restart nuclear reactors if they are confirmed safe.
Japan shut down all its nuclear reactors after Fukushima. The two reactors at Fukui resumed operations in August 2012, the first and only ones to do so.
In September last year they were stopped for regular safety checks.