Different antigens are present in A,B, AB and O type blood.

Humans can have blood types A, B, AB or O depending on what type of antigens are present on their red blood cells. A recent study in PNAS determined that these blood types existed in early humans and even in apes and chimps. From Science News:

Different forms of a single blood type gene determine what types of molecules sit on your red blood cells: type A molecules, type B molecules, A and B together, or no intact surface molecules in the case of type O (O was originally called type C, then was changed to O for the German “ohne,” meaning “without”).

The A, B and O versions of the gene differ only slightly, and scientists have debated two scenarios to explain their evolution. One posits that the A version of the gene existed long ago, and the B and/or O versions later cropped up independently in several species (including humans, gorillas, baboons and chimps). Alternatively, all of those species may have inherited the A and B types from a single ancestor.

To get some bloody perspective on the matter, researchers led by Ségurel looked at a particular stretch of DNA in the blood type gene in humans, bonobos, chimpanzees, gorillas, orangutans and several species of monkey. Then the scientists compared that stretch of DNA across species on the larger primate family tree. The pattern they saw suggests that the A and B blood groups were around at least 20 million years ago, well before the chimp-human split, and probably as far back as the common ancestor of humans and old-world monkeys. Sections of DNA in the human A version, for example, more closely matched the A version that gibbons have than the human B version of the gene.

Exactly why evolution would favor a mix of blood types in so many species is a mystery. Depending on blood type, people are more or less susceptible to particular pathogens. Type O people, for example, are more susceptible to cholera and plague, while people with type A are more susceptible to smallpox. Blood group diversity may have been maintained for so long because each version was immunologically advantageous in certain times and places.