They first found the virus was present in Barcelona on 15 January 2020, 41 days before the first case was officially reported there.
Then they ran tests on samples taken between January 2018 and December 2019 and found the presence of the virus genome in one of them, collected on 12 March 2019.
"The levels of SARS-CoV-2 were low but were positive," research leader Albert Bosch was quoted as saying by the university.
The research has been submitted for a peer review.
The World Health Organization declared the COVID-19 outbreak a pandemic on 11 March this year.
Dr Joan Ramon Villalbi of the Spanish Society for Public Health and Sanitary Administration told Reuters it was still early to draw definitive conclusions.
"When it's just one result, you always want more data, more studies, more samples to confirm it and rule out a laboratory error or a methodological problem," he said.
There was the potential for a false positive due to the virus' similarities with other respiratory infections.
"But it's definitely interesting, it's suggestive," Mr Villalbi said.
Mr Bosch, who is president of the Spanish Society of Virologists, said that an early detection even in January could have improved the response to the pandemic.
Instead, patients were probably misdiagnosed with common flu, contributing to community transmission before measures were taken.
Professor Gertjan Medema of the KWR Water Research Institute in the Netherlands, whose team began using a coronavirus test on waste water in February, suggested the Barcelona group needs to repeat the tests to confirm it is really the SARS-CoV-2 virus.
Spain has recorded more than 28,000 confirmed deaths and nearly 250,000 cases of the virus so far.
People in Australia must stay at least 1.5 metres away from others. Check your state’s restrictions on gathering limits.
Testing for coronavirus is now widely available across Australia. If you are experiencing cold or flu symptoms, arrange a test by calling your doctor or contact the Coronavirus Health Information Hotline on 1800 020 080.
The federal government's coronavirus tracing app COVIDSafe is available for download from your phone's app store.
SBS is committed to informing Australia’s diverse communities about the latest COVID-19 developments. News and information is available in 63 languages at sbs.com.au/coronavirus