Meconium is the baby's initial stool.  Meconium is liquid and sticky and usually greenish or dark brown color and can be passed before or after birth.  Meconium contains everything the fetus has ingested while in the womb, such as mucus, amniotic fluid, water, lanugo (that downy hair babies have) and intestinal epithelial cells. 

Meconium can be passed before birth into the amniotic fluid. About 5-20% of all births are associated with meconium passed by the baby into the amniotic fluid before birth. It is more likely to happen if you go past your due date. If meconium is passed before birth, the normally clear amniotic fluid is tinged with green or brown. In over 90% of these cases, passing meconium into the amniotic fluid is normal and not dangerous.
If the baby inhales (aspirates) the meconium-stained fluid before birth or during delivery, or with his first breath, s/he may develop what is called meconium aspiration syndrome (MAS). 
This can happen because the  meconium is thick and sticky and it may block the airways, thus lowering the efficiency of gas exchange in the lungs; the meconium-tainted fluid may also irritate and inflame the airways, possibly leading to chemical pneumonia. 
Doctors usually watch babies with meconium closer than usual and treat babies with meconium aspiration carefully to prevent complications.