Three people have died and 12 others have fallen ill in Australia after eating melons contaminated with listeria bacteria.

The outbreak of the infection was first spotted last month and is being linked to a farm in Nericon, New South Wales.

Two of the deaths are from the same state while the third, which was confirmed on Friday, was in Victoria.

Health authorities said all contaminated fruit had been removed from supermarket shelves but warned pregnant women and the elderly to stay away from pre-cut rockmelon, also known as cantaloupe.

“All 15 cases are elderly people, and most of them have significant underlying health conditions,” said Vicky Sheppeard, director of communicable diseases for NSW Health in a statement.

"People vulnerable to listeriosis should discard any rockmelon purchased before 1 March."

Of the 15 cases of listeriosis, it has been confirmed that six are from New South Wales and five are from Victoria. Others have been reported in Queensland and Tasmania.

Victoria’s Deputy Chief Health Officer Brett Sutton stated the Victorian cases include three men and two women aged between 65 and 88.

"Tragically, one of these cases has died", Dr Sutton said.

NSW Health defended its response to the outbreak by insisting it followed guidelines that have been in place for 15 years.

They first issued a warning about listeriosis on 23 February after noting “a sudden increase in cases across the state this year”.

A second warning was put out on 28 February after rockmelon was identified as the likely source.

“NSW Health expresses its sympathy to those affected by the outbreak, but reassures the community that all appropriate process and procedures were followed,” the government body said in a statement issued on Saturday.

“NSW Health takes outbreaks very seriously, and immediately investigates to identify likely sources and put in place alerts to protect public health.”

Listeriosis has killed more than 170 people in South Africa since January last year and an outbreak linked to cantaloupe melons in the US in 2011 claimed 30 lives.

The infection starts with flu-like symptoms such as fever, chills and nausea and can take up to six weeks to appear.