Which came out first Fullmetal Alchemist the manga, Fullmetal Alchemist the anime or Fullmetal Alchemist Brotherhood?
2001 to 2010 - the manga is published.
Fall 2003 to Fall 2004 - the first anime is aired.
Spring 2009 to Summer 2010 - the second anime (Brotherhood) is aired.
As you can see, the ending of the manga was timed to coincide with the end of Brotherhood.
The manga is the original production. The anime equivalent was loosely based on that manga, until the production caught up with the manga. At that point, the anime took its own initiative and came up with a story. Brotherhood is a re-make of the entire completed manga, and is pretty much the same as the manga is.