Placenta

The placenta is a temporary organ in the uterus (womb) of pregnant female mammals.  Its main role is to transfer oxygen and nutrients from the mother's blood to the baby's blood, and to transfer waste molecules back from the baby's blood to the mother's.  It also protects the baby from  harmful substances in the mother's blood, and produces hormones that support the pregnancy.  

The placenta is attached to the wall of the uterus and connected to the baby by big blood vessels in the umbilical cord. After the baby is born, the placenta and cord are also pushed out of the uterus. At this time the placenta and cord are often called the afterbirth.

Functions

The placenta feeds the baby and removes its wastes 
The baby in the womb gets everything it needs through the placenta.  Oxygen travels in the mother's blood from her lungs to the placenta and then in the baby's blood through the umbilical cord to the baby.  Carbon dioxide waste travels the same route in reverse, from the baby's blood to the mothers blood and out through her lungs.  Nutrient molecules (sugars, fats, proteins and vitamins) travel through her blood from her digestive tract to the placenta, and then in the baby's blood to the baby, and waste products travel back to her kidneys for disposal.

The placenta protects the mother and fetus 
One of the placenta's jobs is to make sure blood from the mother and fetus never mixes. The placenta acts as an exchange surface between the mother and the fetus. Nutrients and oxygen are passed from one bloodstream to the other by diffusion only. If the mother's and fetus's blood mixed, it could be deadly for both of them. If the mother and the fetus had different blood types, they might both die if their blood mixed.

The placental barrier protects the fetus 
The placenta has two parts, one of which is genetically and biologically part of the fetus, the other part of the mother. It is implanted in the wall of the uterus, where it receives nutrients and oxygen from the mother's blood and passes out waste. This forms a barrier called the placental barrier, which filters out some substances which could harm the fetus. 

However, the placental barrier is not able to protect the fetus from everything that could hurt it.  For example, alcohol goes through the placental barrier into the fetus.  This is why drinking alcohol during pregnancy can cause Fetal Alcohol Syndrome.  The placenta is also unable to filter out many other things.  Chemicals that can cross the placental barrier and hurt the fetus are called teratogens.  Some viruses can also cross this barrier and infect the fetus.  On the good side, many of the mother's antibodies can pass through the placenta, and these can help the baby resist diseases in its first year.

The placenta produces hormones 
Throughout pregnancy the placenta produces hormones that travel through the mother's blood and help her body adapt to the pregnancy.  One of these hormones is detected by pregnancy tests; it also is responsible for the nausea many women experience early in pregnancy ('morning sickness').  Once the baby is ready to be born, the placenta produces hormones that stimulate labor.

Placenta-like organs in other animals 
The egg-laying mammals (echidna and platypus) and marsupial mammals produce a type of placenta that provides nutrients mostly from the egg sac, instead of from the mother's blood. It is positioned in the female's body similar to eutherian mammals.  Non-mammals who give birth to live young rather than laying eggs (some snakes and lizards, and even some fish), have also evolved systems of internal development with a placenta-like tissue: these are examples of convergent evolution.

References 

Pregnancy and childbirth