A team from Strathclyde University in Glasgow tested 22 different brands of compost and found that 14 contained a variety of Legionella species.
It says a larger survey is needed to determine the extent of the issue.
The study, "Legionella spp. in UK composts - a potential public health issue", is published by Clinical Microbiology and Infection.
Dr Beattie, one of those who conducted the study, said: "Disease causing micro-organisms are widespread in the environment, and therefore it is not too surprising that species of Legionella that can cause human disease are present in compost.
"Any environment where you have pathogenic bacteria could be a source of infection, and we already know that compost has been linked to human Legionella infection in countries such as Australia and New Zealand."
Dr Beattie said European produced composts have traditionally been composed of peat, whereas those from Australia and New Zealand had more often used sawdust and bark.
"It may be that the change in composition of composts in the UK, moving away from peat-based products, could be resulting in species such as Legionella longbeachae being present in compost and therefore more cases of infection could occur," she said.
Dr Beattie wants a larger scale survey, covering a wider range of compost products, to be carried out to see if Legionella bacteria are as widespread in composts as her study suggests.
She added: "It should be emphasised though, that although Legionella seem to be common in compost, human infection is very rare, especially if you consider the volume of compost sold and used.
"But with any potential source of infection precautions should always be taken.
"The occurrence of these bacteria in composts in Australia and New Zealand, and the cases of infection that have been traced to compost has resulted in hygiene warnings on compost packaging in these countries, and this is something manufacturers in the UK may wish to consider."
The study was conducted by Dr Tara Beattie, fellow academic Dr Charles Knapp, Strathclyde PhD student Sandra Currie and Dr Diane Lindsay of the Scottish Haemophilus, Legionella, Meningococcus and Pneumococcus Reference Laboratory.

Latest figures released by EMAS reveal it has a £8.74m deficit - 20 times higher than predicted.
The NHS Trust Development Authority, which monitors trusts, said it was working closely with the service to help address financial pressures.
EMAS said it has spent more on extra vehicles, staff, training and overtime payments.
It had predicted an overspend of about £500,000 at the start of the year.
The money problems at EMAS are getting worse.
One of the biggest problems is handover delays to A&E because they're too busy to accept patients straight away.
So far this year, more than 10,000 patients have had to wait more than an hour and because the ambulance service gets paid for each patient it takes to hospital, they are losing out.
Also the NHS would like to treat more people at home, but of course it is a financial disincentive.
Our busiest A&E department at Leicester Royal Infirmary is trying to sort it out, but I don't think there's any quick fix.
EMAS claims it is owed £2.6m in compensation for the handover delays, which has contributed to the overspend.
The deficit could rise as demand for the emergency service traditionally increases in January and February.
Richard Wheeler, director of finance of EMAS, said: "The challenges we face come with an increase in cost, including cost of training and upskilling our frontline staff, given the national shortage in paramedics.
"[Also an] increased cost in providing additional staff and vehicles to cover for staff delayed at hospitals, and also extra payments for shifts which don't finish on time.
"Our five-year business plan... will contribute financially and to future sustainability.
"We will not do anything that will impact negatively on patient safety or care," he added.
A spokesperson for the NHS Trust Development Authority said: "It is a challenging time... and [we] are working closely with EMAS to help them address ongoing pressures around finances."

The 18-year-old scored twice in 15 appearances, mostly from the bench, last season, including the goal that relegated rivals Dundee United.
He spent the first half of the campaign on loan at Raith Rovers, netting once.
"We are looking forward to the continuation of his development over the next three years," manager Paul Hartley told the club website.
Legionella bacteria appears to be "common" in many compost brands sold in the UK, a study has found.
[NEXT_CONCEPT]
East Midlands Ambulance Service (EMAS) has overspent by almost £9m so far this financial year.
[NEXT_CONCEPT]
Dundee striker Craig Wighton has signed a new three-year contract, keeping him at Dens Park until the summer of 2019.