Australian PM Scott Morrison says the country's major political parties and parliament were hit by a "malicious intrusion" on their computer networks.
The activity was carried out by a "sophisticated state actor", he said.
But he added there was "no evidence of any electoral interference". The nation will hold an election within months.
Mr Morrison's comments follow an investigation into the hacking attempt, which was first thought to involve only the parliament's servers.
"During the course of this work, we also became aware that the networks of some political parties - Liberal, Labor and Nationals - have also been affected," he told the House of Representatives on Monday.
The prime minister did not say which foreign state, if any, was under suspicion. He said he would not provide additional detail on "operational matters".
The Australian Cyber Security Centre said that although party systems had been compromised, it was not yet known if information had been stolen.
Australia 'not exempt'
Mr Morrison, who leads the Liberal-National coalition, said: "We have put in place a number of measures to ensure the integrity of our electoral system."