Kugyō (公卿) is the collective term for the most important officials attached to the court of the Emperor of Japan in pre-Meiji eras. The term generally referred to the Kō (公) and Kei (卿) court officials and denoted a court rank between First Rank and Third Rank under the Ritsuryō system, as opposed to the lower court nobility, thus being the collective term for the upper court nobility. However, later on some holders of the Fourth Rank were also included.
In 1869, following the Meiji Restoration, the court nobility and daimyo were merged into a new peerage, the kazoku.