Japan's nuclear watchdog, the Nuclear Regulation Authority, had previously given a green light to the reopening of reactors 3 and 4 of the Kansai Electric Power Company's Takahama nuclear plant.
But locals successfully petitioned the court in Fukui Prefecture, where the plant is located, raising concerns about whether the reactors would survive a strong earthquake.
Japan's 48 nuclear reactors are offline in the wake of the Fukushima disaster in 2011, when a tsunami triggered by a massive earthquake sent a wall of water crashing into the power plant.
Since then, the island nation has imported greater amounts of expensive natural gas and coal to meet its energy needs.
Japanese Prime Minister Shinzo Abe has pushed for a return to nuclear energy, arguing it is essential to the country's economic recovery to reduce the skyrocketing utility bills associated with energy imports.
But opinion polls have consistently shown public opposition to a nuclear restart.
Keith Henry, managing director of Tokyo-based Asia Strategy, which advises businesses on Japanese public policy issues, says the decision will force Abe to rethink the economics of his energy policy.
"That was a body blow [for Abe] because it's no longer a political issue, it's a legal issue. It changes the calculus and the dynamics," he said.
"It's now in the courts. And the government is powerless to do anything about it."
Anti-nuclear activists celebrated following the Fukui District Court's decision in their favor Tuesday.
The nuclear plant operator had argued in court that the plant was safe, meeting heightened safety regulations introduced by the nuclear watchdog following the Fukushima disaster.
It said in a statement
that "scientific and professional findings" showed that the safety of the reactors was assured.
But the court ruled that the new safety standards were "loose," lacked rationality and could not guarantee the safety of the plant, an official said.
The power company said it would appeal the decision. "We deeply regret that our assertion was not well comprehended, and cannot accept it at all," it said in a statement
Chief Cabinet Secretary Yoshihide Suga told reporters Tuesday that the country's nuclear watchdog had deemed the plant safe according to the "world's strictest" safety standards.
The government had no intention to change course on its planned nuclear restart, he said.
Takahama was one of two nuclear facilities granted approval to resume operations.
Sendai nuclear power plant in Kagoshima Prefecture has been granted approval to reopen by the prefecture's governor, although local residents are seeking to challenge this in court.
Analyst Henry said the renewable energy sector could benefit from the Takahama decision, as the country weighed solar and hydro power as alternatives.
Prior to the Fukushima disaster, about 30% of Japan's energy was nuclear generated.