The show song Anything You Can Do, I Can Do Better might have been written about duetting South American wrens, which, researchers have discovered, defend their territories by out-singing their rivals.
Birdsong expert Peter Slater, natural history professor at St Andrews University, and researcher Lorraine Marshall-Ball have been investigating wrens in Costa Rica.
Male and female wrens are known to duet to signal their devotion to one another but the St Andrews team has discovered that they also belt out songs to intimidate intruders.
Professor Slater and Dr Marshall-Ball played birdsong to simulate new arrivals and found that the resident wrens responded by duetting in pairs to match the song types of the incomers.
As in the show-stopper from Annie Get Your Gun , the resident birds became involved in musical combat. They began to sing faster and more often. And in some cases, they went further by approaching and attacking the incomers, still singing loudly.
Dr Marshall-Ball said: "The pairs respond to one another's duets in a 'listen then reply' pattern known as countersinging. This allows both pairs to assess the other's duetting ability, and their aggression level, by listening to how often they sing, how close they are, and whether or not they are singing the same song types."
Previous studies have shown that individual singing and matching an intruder's song is used as a territorial signal but, until now, nobody has looked at duetting birds for this kind of aggressive behaviour.
Dr Marshall-Ball said the joint song seemed to work in two ways. It signals to other pairs that the resident birds are ready to defend their territory and also shows the wrens' commitment to each other.
The research paper Duet Singing and Repertoire Use in Threat Signalling of Individuals and Pairs is published in the Royal Society journal Biology Letters .