The original layout of the building, which remained unfinished and destined for the Scuderie Vicereali, of which only the piperno portal on the western side along Via Santa Teresa remains today, was built in 1585 by order of the viceroy of Spain, Don Pedro Giron, architect Giovanni Vincenzo Casale. The structure was transformed, between 1610 and 1615, by the architect Giulio Cesare Fontana, in order to transfer the Studies (ancient University).
The initial project, which involved the construction of a factory characterized by a two-storey central body, raised with respect to the two side wings at a single level, was not completed as only the western wing and the central body were completed. The facade, richly decorated, had a succession of alternating windows and niches, interrupted only by the main door and the two side secondary.
The windows, with frames variously decorated, were surmounted by marble vases located on the pediments and medallions with half busts, while in the niches were ancient statues with modern integrations. The cornice of the palace was completed by a marble balustrade with vases and pinnacles. Also the central body was surmounted by statues on the sides of the tympanum, and by vases and obelisks to flank a small arched structure with the clock bell.
In the building the Neapolitan University remained for over a century and a half until its transfer to the Royal Boarding School of the Saviour in 1777. At the end of the eighteenth century the architects Ferdinando Fuga, first, and Pompeo Schiantarelli, then, were preparing to expand the old Palazzo degli Studi to convert it into a Universal Museum, according to the cultural model then in vogue: «for the use of the Real Museo di Portici, the Quadreria di Capodimonte, the Gran Libreria Publica, the Schools for the three Fine Arts (Painting, Sculpture and Architecture), and the Room for the study of the Nude». In these years the Palace lost almost all its sculptural decorations and, raised of a plan, it assumed the more compact and imposing aspect that still today characterizes it. The workshops for the Schools of Fine Arts were placed in the rooms of the eastern wing of the first floor articulated around the great Hall of the Sundial, so called for the presence of a solar clock installed there when originally the environment was intended for astronomical observatory.
The room, frescoed by Pietro Bardellino with a celebratory epigraph and an allegorical scene dedicated to Ferdinand IV together with his wife Maria Carolina as protectors of the sciences and the arts, and, on the walls, eighteen paintings by Giovan Battista Draghi of historical subject, was then transformed into a library. Between 1821 and 1825 the architect Pietro Bianchi, after having finished the restoration work, completed the building, with the enlargement of the north-eastern corner, also taking care of the arrangement of the statue of Ferdinand I of Bourbon depicted under the guise of Minerva, performed by Antonio Canova, in a specially designed niche in the middle of the monumental staircase of the Museum. The first setting up of the Royal Bourbon Museum, undertaken by Michele Arditi in 1807, could be considered concluded in 1830 according to the criteria of the time, typological and material classes, with the addition of other inputs for donation or purchase and finds from excavations carried out in the territories of the Kingdom of Naples.
In 1860, with the Unification of Italy, the Royal Bourbon Museum became the property of the State, assuming the new name of "National Museum". Between 1863 and 1875, in addition to being enriched by the remarkable Santangelo collection, it was completely reorganized by Giuseppe Fiorelli, according to a typological criterion. The new reorganization carried out by Ettore Pais between 1901 and 1904 was followed by individual collections, made possible also by the availability of new spaces created with the transfers, in 1925, of the Library in the Royal Palace of Naples and, in 1957, the Pinacoteca in the present Museum of Capodimonte. Only the rich collections of antiquities remained, so that the Museum began to assume its present identity as an Archaeological Museum. The museum building is also home to the Special Superintendence for Archaeological Heritage of Naples and Pompeii.