The position of rikshistoriograf (Swedish, known in Latin as historiographus regni, i.e. Historiographer of the Realm or Royal Historiographer), existed in Sweden from the early 17th century until 1834.
The first appointment of a similar nature was that of the Dutch scholar Daniel Heinsius, appointed in 1618 by Gustavus Adolphus to be historicus regni, but it is not known if he did anything as part of this position. In the reign of Queen Christina, several individuals were appointed either just "historiographer" or "historiographer royal", with occasionally several at the same time holding the position. In 1642, Arnold Johan Messenius and Johannes Loccenius are mentioned as historiographers, a couple of years later Bogislaus Philipp von Chemnitz, and a few years later they are all called rikshistoriograf. The title was also given to Johannes Casparus Freinsheimius and Johan Henrik Boeclerus. Johannes Widekindi was appointed in 1665, later accompanied by Samuel von Pufendorf.
Several of the early historiographers royal were foreigners, but the statutes of 1720 for the royal chancellery prescribed that the position had to be filled by a person of Swedish nationality. The following holders of the position were Claudius Örnhiälm, Petrus Lagerlööf, Olof Hermelin, B. Högvall, Jacob Wilde, Olof von Dalin, Magnus von Celse, Anders Schönberg, Jonas Hallenberg and Friedrich Conrad Albrekt Broman, the last three partly concurrently, with Hallenberg, who held the position until his death in 1834, being the last to do so; it was formally abolished in 1835.