Two people have died in New South Wales and up to 10 others across the country have been affected by a listeria outbreak tied to rockmelons.

Authorities have issued a warning to people most vulnerable to listeria infection including elderly, pregnant or immune compromised to avoid eating rockmelon and to discard the fruit if they have it at home.

Listeria can be extremely serious and even life-threatening for vulnerable people.

The NSW Food Authority has issued a warning to people most vulnerable to listeria infection to avoid eating rockmelon. (AAP)

Doctors have warned people to closely monitor themselves and seek professional advice if they show any of the above symptoms. (9NEWS)

Read more: Rockmelons pulled from shelves amid deadly listeria outbreak

“It’s a very nasty bacterium. (Listeria) has a death rate of 20 percent or more,” Professor of Infectious Diseases Robert Booy told the TODAY Show this morning.

“It can contaminate fruit, vegetables and meat.”

All states are working together to investigate the outbreak with 10 cases identified in elderly patients in New South Wales (six), Victoria (one) and Queensland (three) between January 17 and February 9.

All 10 cases consumed rockmelon prior to their illness.

The outbreak has been linked to a grower in Nericon in the Riverina region of New South Wales.

The company promptly ceased production on Friday after being notified of a potential link to illness and is working with the authority to investigate how the cantaloupes were contaminated.

Prof. Booy added that any rockmelon purchased before Wednesday should be binned as a precaution.

“Don’t put it in your green waste, bin in.”

Rockmelons currently sold is supermarkets are not implicated in the outbreak.

Listeriosis starts with flu-like symptoms such as fever, chills, muscle aches, nausea, and sometimes diarrhoea.

The symptoms can take a few days or even up to six weeks to appear after eating contaminated produce.