A new species of a parasitic wasp with a grisly life cycle that involves laying its eggs inside flies has been found in Ireland, Galway University said on Thursday.

The chance discovery was made by Welsh researcher Chris Williams who is studying the life-cycle of tiny snail-killing marsh flies in County Mayo in the west of the country.

Williams, who is studying for his PhD in Galway, was waiting for flies to hatch in jam jars on his desk when, to his surprise, two different species of parasitic wasp emerged instead.

"I came across two little black Marsh Fly puparia and kept them in jam jars on my desk expecting that adult Marsh Flies might hatch but what emerged were two different species of parasitic wasp," Williams said.

International experts, including Dr Lloyd Knutson from Italy, Dr Gavin Broad of the Natural History Museum in London and Drs Ilari Saaksjarvi and Reijo Jussila from Finland, were consulted in the identification process.

"When we finally discovered that one of these insects had never been recorded before, the question then was what to call this creature," Williams said.

"After resisting the temptation to name it after someone I know -- who really wants to be named after a parasite? -- we settled on naming it Mesoleptus hibernica in honour of the country where it was discovered."

It is the first time a parasitoid species new to science has been discovered in the genus Mesoleptus in Ireland. Only three species of this genus are currently recorded for Ireland.

Williams said a number of families of wasp lay their eggs inside fly larvae or pupae and are known as parasitoids.

The wasp eggs then hatch out and feed on the maggot or pupa, eventually killing it. Subsequently, the wasp larvae pupate inside the maggot, or fly pupa, and emerge as adult wasps.