Both victims are from the hardest-hit town of Mashiki, about 15 kilometers (9 miles) east of Kumamoto city on the island of Kyushu, said Kumamoto prefecture disaster management official Takayuki Matsushita.
Earlier, Japanese Red Cross Kumamoto Hospital said it had admitted or treated 45 people, including five with serious injuries.
The quake struck at 9:26 p.m. at a depth of 11 kilometers (7 miles) near Kumamoto city on the island of Kyushu, the Japan Meteorological Agency said. There was no tsunami risk.
"The shaking was so violent I couldn't stand still," said Hironobu Kosaki, a Kumamoto Prefectural Police night-duty official.
Japan's Chief Cabinet Secretary Yoshihide Suga said at least 19 houses collapsed, and hundreds of calls came in reporting building damage and people buried under debris or trapped inside.
"Because of the night darkness, the extent of damage is still unclear," he said.
The damage and calls for help are concentrated in the town of Mashiki, about 1,300 kilometers (800 miles) southwest of Tokyo, Japan's Fire and Disaster Management Agency said
One of the victims in Mashiki died after being pulled from some rubble, and the other was killed in a fire, Matsushita said. A third person rescued from under a collapsed building is in a state of heart and lung failure.
Matsushita said rescue operations were repeatedly disrupted by aftershocks.
"There was a ka-boom and the whole house shook violently sideways," Takahiko Morita, a Mashiki resident said in a telephone interview with Japanese broadcaster NHK. "Furniture and bookshelves fell down, and books were all over the floor."
Morita said some houses and walls collapsed in his neighborhood, and water supply had been cut off.
Dozens of people evacuated their homes and gathered outside Mashiki town hall, sitting on tarps well after midnight. Some wrapped blankets around their shoulders against the springtime chill.
Prime Minister Shinzo Abe told reporters that the government has mobilized police, firefighters and self-defense troops for the rescue operation.
"We'll carry out relief operation through the night," he said.
Suga said there no abnormalities at nearby nuclear facilities. The epicenter was 120 kilometers (74 miles) northeast of Kyushu Electric Power Co.'s Sendai nuclear plant, the only one operating in the country.
Most of Japan's nuclear reactors remain offline following the meltdowns at the Tokyo Electric Power Co.'s Fukushima plant in 2011 after a magnitude 9.0 earthquake triggered a huge tsunami.
Television footage showed fires breaking out in some places, with firefighters battling an orange blaze.
Keisukei Urata, an official in nearby Uki city who was driving home when the quake struck, told NHK that parts of the ceiling at Uki City Hall collapsed, windows broke and cabinets fell to the ground.
Kasumi Nakamura, an official in the village of Nishihara, said that the rattling started modestly and grew violent, lasting about 30 seconds.
"Papers, files, flower vases and everything fell on the floor," he told NHK.
There were multiple aftershocks, the largest one with a preliminary magnitude of 6.4 shortly after midnight, according to the Japan Meteorological Agency.
The U.S. Geological Survey measured the initial quake's preliminary magnitude at 6.2. It upgraded its damage assessment to red, meaning extensive damage is probable and the disaster likely widespread.
Footage from an NHK bureau in the area showed books, files and papers raining down to the floor. One employee appeared to have fallen off a chair, while others slid under their desks to protect their heads.