Clouds of smoke poured from the Kashiwazaki nuclear power plant
A strong earthquake in central Japan has damaged a large nuclear power plant causing a leak of radioactive material, officials at the plant have said.
A small amount of water containing radioactive substances leaked into the sea, officials said, and a fire broke out at the plant in Kashiwazaki.
At least seven people were killed and hundreds injured in the earthquake.
Several hours later a second earthquake of magnitude 6.6 struck in the sea off Kyoto in western Japan.
Tokyo Electric Power Company said the small amount of radioactive material that leaked into the sea posed no environmental risk.
Reactors at the plant automatically shut during the magnitude 6.8 quake.
The seven deaths occurred in the city of Kashiwazaki.
Four women and three men - all in their 70s and 80s - died from injuries sustained in the earthquake, officials said.
Several hundred homes and businesses in Niigata prefecture were destroyed, roads were cracked and several landslides buried roads.
More than 800 people were reported injured, most with broken bones, cuts and abrasions from collapsing buildings and falling objects.
"First there was a sharp vertical jolt and then it shook sideways for a long time and I couldn't stand up," said Kashiwazaki teacher Harumi Mikami, who was at her school when the earthquake struck at 1013 (0113 GMT).
"Tall shelves fell over and things flew around," she told Reuters news agency.
More than 7,000 people were evacuated from their homes as aftershocks of up to magnitude 5.8 shook the area.
No damage from the second earthquake deep under the sea off Kyoto was reported but Tokyo residents said they felt buildings shake.
Japanese Prime Minister Shinzo Abe broke off from election campaigning to visit Kashiwazaki.
He promised to "make every effort towards rescue and also to restore services such as gas and electricity".
The safety of Japan's nuclear installations, which supply much of Japan's power, has come under the spotlight in recent years after a string of accidents and mishaps.
Japan lies in one of the world's most earthquake-prone regions and the ability of some reactors to withstand a strong tremor has been questioned.
Three years ago an earthquake in the Niigata area killed 65 people.
In 1995, a magnitude 7.3 tremor hit the city of Kobe, killing more than 6,400 people.