Beef from illegally slaughtered cows infect five with anthrax. Nigel Williams/Creative Commons

Five people have been hospitalised in Hungary after apparently eating anthrax-infected beef.

Authorities said the deadly virus was discovered in samples from two animals that had been slaughtered illegally.

All five people were admitted to hospital and are being monitored, while officials said anyone who could have come into contact with the infected beef will be treated with antibiotics as a precaution.

Officials also said people who think they might have come into contact with the beef should see a doctor, as early treatment is most effective at treating the virus.

The meat had been slaughtered and improperly frozen in Tiszafured, a town 160km east of Budapest.

It was then transported to a company that operates restaurants and hotels. The company's kitchen has since been closed, the National Public Health and Medical Officer Service told the Associated Press.

It added that there is no immediate risk of the disease spreading and all animals in the area that may have been exposed to anthrax are currently being vaccinated.

Anthrax is caused by the bacterium Bacillus anthracis and is soil-borne. Spores have a long lifespan and are present across the globe. They remain at sites of animals killed by the virus for decades after death.

It commonly infects herbivorous mammals that eat or inhale the spores while grazing. Diseased animals can then pass on the virus to humans who eat their meat.