Coastguards have arrived at the location, which is around 450 kilometres (280 miles) west of Tokyo, but were "yet to confirm the safety of the eight crew members on board", he said.
Speaking in parliament, Prime Minister Shinzo Abe interrupted a debate to announce: "In waters off Hyogo (prefecture), a tanker has exploded and is currently in flames."
The Kobe Shimbun, a local newspaper, said the vessel was around two kilometres south of the port, which sits in a busy shipping area.
The paper added that the 998-ton ship was not believed to have been fully laden.
Black smoke was seen billowing from the ship, up to a height of 100 metres (300 feet) the paper said, citing a coastguard official.