Between 1803 and 1806, the final years of the Holy Roman Empire, the vast majority of the states of the Holy Roman Empire were mediatised. These states lost their imperial immediacy (Reichsunmittelbarkeit) and became part of other states. The number of states was reduced from about three hundred to about thirty.