The spatharii or spatharioi (singular: Latin: spatharius; Greek: σπαθάριος, literally "spatha-bearer") were a class of Late Roman imperial bodyguards in the court in Constantinople in the 5th–6th centuries, later becoming a purely honorary dignity in the Byzantine Empire.
Originally, the term was probably applied to both private and imperial bodyguards. The original imperial spatharioi were probably or later became also the eunuch cubicularii (Greek: koubikoularioi), members of the sacrum cubiculum (the imperial "sacred chamber") charged with military duties. They are attested from the reign of Emperor Theodosius II (r. 408–450), where the eunuch Chrysaphius held the post. The existence of the specific title of spatharokoubikoularios for eunuchs in 532 probably suggests the existence by then of other, non-eunuch, spatharioi in imperial service. The various generals and provincial governors also maintained military attendants called spatharioi, whilst those of the emperor were distinguished with the prefix basilikoi ("imperial ones"). The officer leading the imperial spatharioi held the title prōtospatharios ("first spatharios"), which became a separate dignity probably in the late 7th century.
By the early 8th century, these titles had lost their original military connotations and become honorific titles. The title of spatharios ranked initially quite high, being awarded for instance by Emperor Justinian II (r. 685–695) to his friend and future emperor Leo III the Isaurian (r. 717–741). It gradually declined, however, and in the Klētorologion of 899, it occupies the seventh-highest place in the hierarchy of ranks for non-eunuchs, above the hypatos and below the spatharokandidatos. According to the Klētorologion, the insignia of the dignity was a gold-hilted sword. At the same time, the term oikeiakos spatharios still designated a bodyguard of the imperial oikos ("household"), as distinct from the basilikoi spatharioi who now were the holders of the honorary dignity. The term ceased to be used in these contexts after circa 1075, and by the time Anna Komnene wrote her Alexiad in the early 12th century, a spatharios was held to be completely insignificant.