Japanese PM Shinzo Abe has accepted his ruling Liberal Democratic Party has suffered "utter defeat" in polls for the upper house of parliament.
Mr Abe has vowed to press on with his reform programme
But as votes were being counted, Mr Abe said he had no intention of resigning.
The opposition Democratic Party of Japan (DPJ) is set to become the largest party in the upper house for the first time.
The LDP has been hit by a series of ministerial gaffes and scandals since Mr Abe took office 10 months ago.
"The responsibility for this utter defeat rests with me," Mr Abe told reporters at his party headquarters in Tokyo.
But he insisted he would not be stepping down - although the deputy leader of the LDP, Hidenao Nakagawa, has resigned.
"I am determined to carry out my promises although the situation is severe," Mr Abe said.
The LDP has a sizeable majority in the more powerful lower house, which chooses the prime minister. But without a majority in the upper chamber, Mr Abe's administration may find it hard to pass the laws that it wants.
The DPJ is led by Ichiro Ozawa
Half of the 242 seats in the House of Councillors were being contested.
Before the election, the LDP-led ruling coalition controlled 132 seats. It needed to win 64 of the 121 seats being contested in order to retain its majority.
With five seats left to be decided, Japan's public broadcaster NHK suggested the ruling coalition had fallen far short of its target, winning 43 seats out of the 76 it was defending.
Previous prime ministers have resigned following upper house defeats that were less severe.
Tomohiro Nakamura, a 53-year-old bank employee in Tokyo, said he had voted for the opposition "because I have no other choice when LDP politics is in bad shape".
However, Nobuyuki Ietaka, a 48-year-old computer company salesman, said he was voting for the ruling party. "I don't think other parties are great and I don't think the opposition could change things at all," he told the Associated Press.
The most significant factor in Mr Abe's falling popularity has been a nationwide pensions debacle, with a government agency admitting it has lost records relating to millions of payments.
Pensions are a key issue in Japan's greying society and, although the mistake was not made under Mr Abe's leadership, many voters have started to question his skills in the job.
Mr Abe, 52, became prime minister following popular leader Junichiro Koizumi's decision to step down last year.
Former Peruvian President Alberto Fujimori failed in a bid to win an upper house seat, campaigning from Chile where he is fighting extradition back to Peru.