Australia's prime minister was hit on the head with an egg and a woman was knocked off her feet Tuesday during a protest ahead of a general election next week.

The egg appeared to strike Prime Minister Scott Morrison on the back of the head then bounce off without breaking as he spoke to voters at a hall in the regional town of Albury.

A female bystander was knocked to the floor as security guards grabbed a 25-year-old woman who is accused of throwing the egg and carried her outside.

Morrison helped the bystander to her feet. He later suggested the protester was part of a militant movement that raids farms that it accuses of cruelty to animals.

"My concern about today's incident in Albury was for the older lady who was knocked off her feet," Morrison tweeted.

"I helped her up and gave her a hug. Our farmers have to put up with these same idiots who are invading their farms and their homes," he added.

Outside the hall, the protester told reporters she did not mean to knock the woman down.

The protester, who did not identify herself, described throwing the egg as "the most harmless thing you can do."

Police later said in a statement the woman had been taken into custody. Police said no injuries had been reported from the incident.

Opposition leader Bill Shorten condemned the protests as "appalling and disgraceful behavior."

"In Australia, we have violence-free elections," Shorten told reporters. "People are allowed to protest peacefully, but anything approaching violence is unacceptable."

Morrison was campaigning in an electorate held by his conservative Liberal Party. The party fears that an independent candidate could win the seat at the election on May 18.