Media playback is unsupported on your device Media caption The swimming jellyfish were tagged with data loggers fitted to their bodies with cable ties

Jellyfish can sense the ocean current and actively swim against it, according to a study that involved tagging and tracking the creatures.

The research, by an international team, could help scientists work out how jellyfish form "blooms".

These blooms may comprise between hundreds and millions of jellyfish, and can persist in a given area for months.

It remains unclear just how the jellyfish sense changes in water, the paper in Current Biology journal says.

The scientists, including researchers from Swansea University and Deakin University in Warnambool, Australia, tagged 18 large barrel jellyfish (Rhizostoma octopus) in the Bay of Biscay, off the coast of France.

The team caught the jellyfish and fitted them with loggers that measured acceleration and body orientation.

Lead researcher Prof Graeme Hays from Deakin University said it was "really easy" to attach the tags. "We loop a cable tie around the peduncle that joins the swimming bell to the trailing arms," he explained.

"It takes seconds, and the tag stays on indefinitely."

At the same time, the researchers used floating sensors to monitor and measure the ocean currents.

Jellyfish facts Image copyright Graeme Hays The scientific name for the barrel species is Rhizostoma , which means "root pores"

, which means "root pores" Jellyfish are the staple diet of the critically endangered leatherback turtle

The blue jellyfish is a common visitor to our coasts from May to October. Its sting is less severe than a nettle sting

The compass jellyfish is prevalent off the south and west coasts of England. It has a saucer-shaped bell, with 32 semi-circular lobes around the fringe

While the Portuguese Man o' War resembles a jellyfish, it is in fact a floating, compound marine animal. It is made up of a colony of four kinds of polyps Source: Marine Conservation Society

This showed that the jellyfish were able actively to swim against the current, apparently in response to feeling themselves drift.

In a second part of the study, the researchers used their data to create a realistic simulation of the movement of a bloom of jellyfish in the ocean.

This showed, said Prof Hays, that "active and directed swimming helps maintain blooms", by keeping jellyfish in a particular area rather than allowing them to be dispersed or washed ashore by the currents.

"With this knowledge of their behaviour we can start to have some predictive capability for bloom dynamics," the scientist told BBC News.

What is not yet clear is how exactly the jellyfish work out which way to travel.

The scientists think the animals might sense the current across the surface of their bodies. They also speculate that the jellyfish might use the Earth's magnetic field to navigate - an ability seen in some other migrating marine species, including sea turtles.

One ultimate aim of studying and tracking swimming jellyfish is to improve the forecasting of jellyfish blooms, which have increased in frequency over the past decade, disrupting fisheries and stinging swimmers.

Perhaps troublingly, these results show that swimming against the current helps hold blooms together, even in areas when currents are strong.

Follow Victoria on Twitter