Experts from the Roslin Institute at the University of Edinburgh said they had found clear evidence that livestock were the original source of an MRSA strain which is now widespread in humans.
It is believed the bug first passed to people through contact between farm workers and animals.
Levels of MRSA in Scotland have decreased significantly in the last few years. In the first three months of 2013, 37 cases of MRSA were recorded across Scotland, compared with 274 in the same period in 2006.
For the latest study, the Edinburgh researchers studied the genetic make-up of more than 40 strains of the bacterium Staphylococcus aureus.
This bug can build resistance to the antibiotic methicillin, leading it to become MRSA (methicillin-resistant Staphylococcus aureus).
The scientists found that at least two genetic subtypes of the bacterium, which have become endemic in people, could be traced back to cattle.
The results will now help researchers find out how the bacteria are able to spread and cause disease in humans, and to prevent further strains from jumping from livestock. They did not believe the spread could have happened by eating meat.
After switching to human hosts, the Staphylococcus aureus bacteria became resistant to methicillin, and acquired the ability to avoid attack by the human immune system.
But the researchers, writing in the journal mBio, said the bacteria that originated in cattle did not appear to be more aggressive or more resistant to antibiotics than other types of MRSA affecting humans.
Lead researcher Professor Ross Fitzgerald said: “Human infections caused by bacteria being transmitted directly from livestock are well known to occur.
“However, this is the first clear genetic evidence of subtypes of Staphylococcus aureus which jumped from cattle and developed the capacity to transmit widely among human populations.”
Prof Fitzgerald said the research would hopefully help stop other bugs jumping from animals to humans in future.
“What it does is identify this possible source of new strains which could be harmful to humans, particularly which could spread in human populations,” he said. “This could lead to better control measures in the farms to prevent such host jumps happening in the first place.
“In hospitals we know that better hygiene measures have been very effective in leading to a reduction in MRSA infections. So perhaps we need to think about improved hygiene at the food level as well.”