PestControlBasics
Menu

Mushroom Phorid Fly

Megaselia halterata[7]

The mushroom phorid fly (Megaselia halterata) is a tiny humpbacked fly whose larvae feed on the mycelium in commercial mushroom compost. It cuts mushroom yields and spreads fungal diseases on farms, and in parts of Pennsylvania, Delaware and Maryland wind-blown adults have become a nuisance in homes near mushroom farms.[1][4]

Group
Insect
Order
Diptera
Family
Phoridae
US range
3 states in sources
Sources
7 cited
Updated
2026-11-09

No licensed photo of this species is available yet; the identification notes below describe what to look for.

On this page
  1. Identification
  2. Look-alikes
  3. Where it lives
  4. Biology
  5. Damage and signs
  6. Health risk
  7. Control
  8. Related profiles
  9. Common questions
  10. Sources

How to identify it

  • Adults are very small, usually between 1/64 and 1/8 inch long; Penn State gives the adult female as about 3 millimeters.[1][2]
  • They have a steeply arched, humped back behind the head, and their eyes are dark rather than red like a fruit fly's.[1]
  • The flies have a distinct anise odor.[1]
  • In homes they tend to gather at windows, on upper floors and in attics, and in humid rooms such as bathrooms, because they are drawn to light, walk upward on vertical surfaces and dry out easily.[1]

Look-alikes

Look-alikeHow to tell them apart
Fruit fliesFruit flies have red eyes; the mushroom phorid fly's eyes are dark, and it has a humped back.[1]
Fungus gnats and sciarid fliesSciarid flies are the other main fly in mushroom houses; on farms the phorids may be more numerous but do less damage to the crop.[2][3]
Other phorid fliesMushroom phorid fly larvae can feed only on actively growing mushroom mycelium, so this species does not breed in homes, drains, mulch or yards.[1][4]

Where it lives

It is a pest of mushroom production in many parts of the world. In the United States it has become a major pest in Chester County, Pennsylvania, the top mushroom-producing county, and the flies have invaded more than 150 neighborhoods across about 242 square miles in parts of Pennsylvania, Delaware and Maryland.[5][1]

US map: states where the cited sources report mushroom phorid flies invading neighborhoods near mushroom farms.

Biology and life cycle

Adults mate in swarms outside mushroom houses, mostly at dawn and dusk. Mated females are drawn by the smell of actively growing mycelium in spawned compost and lay their eggs in the compost or casing layer; unspawned compost and fully grown, mature compost attract them less.[2][3][1]

A female can lay up to about 50 eggs. The eggs hatch in 2 to 3 days, and the larvae, at first nearly transparent and later whitish, grow to about 4.5 millimeters while feeding on the mycelium, the only stage that feeds. They pupate in the compost.[3][2][1]

At 65 degrees F the larval stage takes about 14 days and the pupal stage about 20 days. Adults emerge about 20 to 30 days after the eggs are laid, and a study in Iran found development from egg to adult took about 20 to 22 days at 25 to 27 degrees C (77 to 81 degrees F).[2][1][6]

Adults do not eat and are short-lived. They live longer in cool, humid conditions like those in mushroom growing rooms; outside them adults survive only three to five days, and no more than three days above 75 degrees F.[1][5]

Numbers drop in winter, when cold kills adults flying between growing rooms. On farms the flies peak in September and October, and cooler, more humid fall weather lets adults live longer outdoors, which is when neighborhood invasions build.[1][2]

Damage and signs

  • Larvae feed on the mushroom mycelium, reducing yields, and the flies spread fungal diseases on farms. Penn State estimates Pennsylvania growers lose 10 to 40 percent of the crop at peak fly populations.[1][3][4]
  • Around mushroom farms, wind carries adults from the farms into residential areas, sometimes several miles away, where they enter homes in large numbers.[1][4]

Health risk

Penn State describes mushroom phorid flies as a nuisance but not a health concern: they do not sting, bite or carry human diseases.[1]

Control

Prevention

There is nothing to clean out at home: the flies cannot breed in houses, drains, mulch, lawns, mushroom stumps or spent mushroom compost, and those that get inside usually die within two or three days.[1]

Keep them out

Exclusion is the most effective way to reduce flies in a home: keep windows, doors and other openings closed whenever possible and close blinds at night so indoor light does not draw them.[1]

Traps and physical control

Vacuum the flies that collect in bathrooms and on windows. Sticky traps on windows and light traps indoors can also help.[1]

Pesticides

Penn State does not recommend insecticides indoors, because the flies die on their own within a few days and products not labeled for this use in homes can be hazardous to residents. Always follow the label.[1]

When to call a professional

Lasting relief depends on control at the farms. Pennsylvania's Department of Agriculture has required steam treatment of growing houses between crops in parts of Chester County, and Penn State is testing beneficial nematodes, predatory mites, a registered insecticide applied as a spray or fog, and insecticide-treated netting around growing rooms.[4]

Common questions

Why are there hundreds of tiny flies on my windows near a mushroom farm?
They are most likely mushroom phorid flies blown in from nearby mushroom farms. They are attracted to light and gather on windows, upper floors and in bathrooms.[1]
Are mushroom phorid flies breeding in my house?
No. Their larvae can develop only in actively growing mushroom mycelium, so they cannot breed in homes, drains, mulch or yards. Flies that get indoors usually die within two to three days.[1]
Do mushroom phorid flies bite?
No. They are a nuisance but do not sting, bite or carry human diseases.[1]

Sources

  1. Penn State Extension, “Mushroom Phorid Fly Infestations in Mushroom Farms and Surrounding Neighborhoods.” extension.psu.edu/mushroom-phorid-fly-infestations-in-mushroom-farms-and-surrounding-neighborhoods (accessed 2026-11-09)
  2. Penn State Extension, “Phorid Fly in Commercial Mushroom Production (D. M. Beyer).” extension.psu.edu/phorid-fly-in-commercial-mushroom-production (accessed 2026-11-09)
  3. Penn State Extension, “All About Monitoring Mushroom Flies.” extension.psu.edu/all-about-monitoring-mushroom-flies (accessed 2026-11-09)
  4. Penn State University, “Researchers at Penn State developing strategies to reduce mushroom phorid flies (2025).” ento.psu.edu/news/20250218-penn-state-researchers-developing-strategies-to-diminish-mushroom-phorid-flies (accessed 2026-11-09)
  5. Environmental Entomology (via NCBI PubMed), “Biology of Mushroom Phorid Flies, Megaselia halterata: Effects of Temperature, Humidity, Crowding, and Compost Stage (I. Shikano et al.; Environmental Entomology 50(1), 2021; abstract).” pubmed.ncbi.nlm.nih.gov/33211094/ (accessed 2026-11-09)
  6. Neotropical Entomology (via NCBI PubMed), “Temperature-Dependent Development Modeling of the Phorid Fly Megaselia halterata (S. Barzegar et al.; Neotropical Entomology 45(5), 2016; abstract).” pubmed.ncbi.nlm.nih.gov/27147228/ (accessed 2026-11-09)
  7. iNaturalist, “Megaselia halterata taxon page (order and family).” www.inaturalist.org/taxa/123833 (accessed 2026-11-09)

Updated 2026-11-09. Built from sourced records. Spot an error? Tell us.