1590s, "of the highest rank" (originally in literature), from classic + -al (1). Classical music (1836) was defined originally against romantic music.
[I]n general, as now used, the term classical includes the composers active in instrumental music from somewhere about 1700 to say 1830. Hence the list includes among the great names those of Bach, his sons, Haydn, Mozart, Beethoven, Clementi, Dussek, Pleyel, Cramer, etc. The next step beyond the term classical is "modern romantic," the composers of which school may be taken to include all the writers for pianoforte from about 1829 (when Mendelssohn published the first "Songs without Words") down to the present. The term romantic in this sense means strongly marked, extraordinary, intending to tell stories and the like. ["Music, Its Ideals and Methods," W.S.B. Mathews, 1897]
But already by 1880s it was acknowledged the term had a double sense: Music that had withstood the test of time, as well as music of a style contrasted to "romantic." Later (early 20c.) it was contrasted to jazz (in this sense more often with reference to the orchestras than to the music itself). Still later it stood in contrast to popular music generally (mid-20c.). Classical history is the history of ancient Greece and Rome; ancient history is the history of mankind from the earliest reliable records to the fall of Rome (476 C.E.). Related: Classically.