Margrave
A Markgraf ranked higher than a graf, but lower than a duke.  The Margraves of Brandenburg were in control of such an important area that they were made Electors of the Holy Roman Empire, which was the highest honour in the Imperial Parliament.  There were no Kings in the Empire, so when the Margraves of Brandenburg took control of some territory outside the empire as well, they could call themselves King in Prussia.