Prime is a rank of highest distinction in many Transformers continuities. Typically, it is used as the identification for the leader of the Autobots, something that is bestowed only on those that carry the Matrix of Leadership within them. It is retroactively derived from Primus, the creator of the Transformers.

With the retcon that Primus is one singular entity that exists (and must exist) threaded through all Transformer continuities, the term Prime is likewise given one singular origin. It was, first of all, the designation granted by Primus to seven of the Thirteen original Transformers created, by his own hand, at the dawn of the physical universe to crew his planetary form. 

The title of Prime was bestowed upon the civilian and spiritual leader of Cybertron but at the same time, aided the Lord High Protector in stewarding the AllSpark just as the Lord High Protector was co-ruler. Optimus Prime held this title before, during and after the war for the AllSpark as leader of the Autobots.

According to The Quest For the ALLSPARK paperback's opening paragraph, "...Most revered were Optimus and Megatron. They were twin brothers of the Prime dynasty."

This, along with the note from the Autobots version of the same DS game that Megatron "took the spark" of his and Optimus' father, implies that “Prime” may have been their father’s name and that Megatron may have also had the surname "Prime" as well.

In Revenge of the Fallen, its revealed that the Primes were ancient Transformers, the first of the race and that the Dynasty of Primes led the race until the Fallen betrayed his brothers and they sacrificed themselves to prevent him from getting the Matrix of Leadership. By 2007, Optimus Prime was the only Prime known to still be alive (no one knew that Sentinel was still alive in the ruins of the Ark on Earth's Moon) and the only one who could defeat the Fallen as "only a Prime can defeat the Fallen." The Fallen had him killed by Megatron and tried his original plan to harvest Earth's sun for Energon, but was killed by the resurrected Optimus with help from Jetfire and thanks to the efforts of Sam Witwicky.

Eventually, the remains of the Ark are discovered along with the body of Sentinel Prime who is revived by the Matrix of Leadership like Optimus once was. Sentinel is revealed to be a traitor and in a battle, is killed by Optimus Prime with help from Megatron.