PRAGUE (AP) — Czech Prime Minister Petr Necas announced Sunday that he will resign over a spy and bribery scandal involving his government.

Necas said he also will quit on Monday as chairman of his conservative Civic Democratic Party.

He has been under pressure to quit since police conducted raids all across the country this week and arrested eight people, including Necas’ closest aide and the head of his office, Jana Nagyova. She was charged with ordering a military intelligence agency to spy on three people, including Necas’ estranged wife.

Seven other people, including the current and former heads of the Military Intelligence agency and three former lawmakers of his party, were charged with bribery or misuse of power.

“I am aware of my political responsibility,” Necas said.

His decision will end his three-party coalition government, which was created after the 2010 parliamentary election. But Necas said he hopes it can stay in power until a parliamentary election planned next year.

This is an optimal solution of the current situation,” Necas said. Two coalition partners, the conservative TOP 09 party and the Liberal Democrats, agreed with that plan Sunday.

“We’re obliged to do all we can for the government to continue,” said Finance Minister Miroslav Kalousek, the deputy head of TOP 09.

That might not happen, however. It is up to the President Milos Zeman to select a new prime minister who would try to form a new government, and it is not immediately clear if he is ready to accept such a solution. The current coalition also doesn’t have a clear parliamentary majority and governs with the help from independent lawmakers.

Early elections also are not easy to call because it would have to be approved by three-fifths of the 200 lawmakers, and the opposition does not have enough seats to force it.

The negotiations between the parties are expected to start immediately, and it is not clear how much time they will need to find a solution to the crisis.

Earlier this week, prosecutors said Nagyova was suspected of directing the alleged illegal surveillance without any authorization. In their explanation for the sweeping raids at government offices and other locations, they said Nagyova’s motives were “purely private.”

Necas announced earlier this week that he and his wife, Radka, have filed for divorce. Newspapers have speculated about an affair between him and Nagyova.