Japan's prime minister has said he is to resign following the fallout following calls from his party to take responsibility for a disastrous defeat in July's election.

The public broadcaster NHK said Shigeru Ishiba made the decision to avoid a divide within the party, while the Asahi Shimbun newspaper said he was unable to withstand the mounting calls for his resignation.

Ishiba, who took office in October, had resisted demands from mostly rightwing opponents within his party for more than a month.

The conservative LDP and its junior partner Komeito needed to win 50 seats to retain control of the upper chamber, but won 47, as the coalition saw its vote eroded by an increase in support for far-right nationalist parties.

Ishiba called a press conference at 6pm (local time) on Sunday in Tokyo where he said he intended to resign as LDP president and would stay on as prime minister until a new leader is elected.