By the middle of the second decade of the 18th century, Petersburg was a vast territory for those times, mostly built up with randomly scattered wooden houses. However, Peter was driven by a long-standing dream of a city governed by a unified plan. Although he understood that this would require demolishing all the already constructed buildings in the Admiralty part and on the Petersburg side. Under these conditions, the still undeveloped Vasilievsky Island presented an attractive construction site. At the end of 1715, Peter made the decision to build the city center precisely on Vasilievsky Island.
For the first time in Russia, a "competition" was held for the best project, in which the leading architects of that era participated. Peter approved Domenico Trezzini's project, according to which the territory of Vasilievsky Island was to be divided into regular blocks and three central city squares arranged. One of them—the Collegiate Square—was to become the administrative center of the city. One of the borders of this square was to be limited by the extensive facade of the Twelve Collegia building, opening the square towards the Peter and Paul Fortress. Therefore, the building is located not parallel to the Neva River (as was customary), but perpendicular to it. The main facade of the building extends 400 meters deep into the island. The building was intended for important state bodies—the collegia, which were established by the Sovereign to replace the previously existing Prikazy (offices). Also for the Senate, which replaced the Boyar Duma, and the Synod, the main church authority of Russia, which appeared after Peter abolished the Patriarchate.
Trezzini's project was the most economical and rational; it took into account that the main state administration bodies should work together and therefore be located close to each other. At the same time, the effect was created that each collegium occupied a separate building. The building's exterior clearly expresses the features of Petrine Baroque architecture: two-tone painting, rustication of the lower floor, use of pilasters, small-paned windows, as well as high roofs. In the Baroque spirit, the risalits (projecting sections) are crowned with complex-shaped pediments. Above all, there is simplicity and rationality in everything.
The building has survived to this day with some changes. During the reconstruction of the 1830s, caused by the transfer of the building to Petersburg University, the shape of the roofs was partially altered. Moreover, according to Trezzini's plan, the first floor was originally an open arcade, which was later glazed. Today, the Twelve Collegia building remains the main building of Petersburg University. On the memorial plaque, which reads: "Here studied, worked, and lived from 1857 to 1890 the great Russian scientist Dmitry Ivanovich Mendeleev." The inscription speaks for itself.
The name of the outstanding scientist, corresponding member of the Academy of Sciences, inventor of the periodic table of chemical elements, is closely connected with Petersburg University.
Until the end of the 19th century, a huge square stretched in front of the Twelve Collegia building, surrounded by a semicircle of arcades of the New Stock Exchange Guest Yard and warehouses.
The ensemble was closed off by the Stock Exchange building. But at the beginning of the 20th century, according to architect Benois's project, a whole complex of buildings (the Otto Institute of Obstetrics and Gynecology) was built, occupying this entire territory. Thus, the composition of the ensemble, created over many years, was disrupted.
That was the reality. But folklore offers a different explanation. According to one legend, when Peter was about to leave Petersburg one day, he entrusted Menshikov to begin construction of the Twelve Collegia building along the Neva embankment. It was supposed to become a kind of continuation of the Kunstkamera. As a reward, Peter allowed his beloved Danilych to use all the land remaining beside the Collegia for his own palace. The clever Menshikov reasoned that if such a long building were erected along the Neva, the tsar's gift would turn into a handful of useless land. So he decided to build the Collegia building not along the embankment, but perpendicular to it. When Peter returned from his trip, he flew into a rage. Dragging Alexashka by the collar along the entire building, he stopped at each collegium and beat him with his famous club. But nothing could be changed anymore. Of course, this whole story is nothing more than fiction, as it contradicts historical facts. The fact is that Menshikov's palace was built back in 1710. This means that at the time of the palace's construction, the Twelve Collegia building was not even in the project stage. At that time, Peter decided to move the center of Petersburg to Vasilievsky Island, which was covered with forest, after which the coast began to be gradually built up with new buildings.
The Twelve Collegia building is the largest monument of "Petrine Baroque" in size. Its construction was part of Peter I's plan to create an administrative quarter on Vasilievsky Island. It was intended that the building would house not only the collegia but also the Senate and the Synod.
Construction began in 1722, and at the same time, piles were driven for the foundation. From 1724, the construction work was supervised by architect Theodor Schwertfeger. Before the emperor's death, the foundation was completed and wall laying had begun. In 1734, Trezzini died, and architect Mikhail Zemtsov took over supervision of the construction; in 1736, he was replaced by Giuseppe Trezzini, Domenico's son-in-law. The Twelve Collegia were fully completed only in 1744, but the first collegiate meeting took place as early as 1732.
The three-story building consists of twelve identical sections stretched in a line 383 meters long. Each section has a separate mansard roof and a central risalit with a shaped pediment. The southern end of the building faces the shore of the Bolshaya Neva. A canal was started to be dug in front of the eastern facade but was soon filled in. On the rear, western side, a two-tier gallery runs along the entire length of the building, constructed between 1734–1740 by architect Giuseppe Trezzini.

The southernmost building closest to the Neva housed the "audience chamber," the second housed the Senate. The next buildings were occupied by the Foreign and Military collegia. The fifth building was constructed for the Admiralty Collegium, but it was moved to the Admiralty. The sixth was intended for the Chamber and Revision collegia, which mainly worked in Moscow. The seventh housed the Justice Collegium, which also used the fifth building. The eighth was occupied by the Commerce Collegium, the ninth by the Mining Collegium, the tenth by the Manufactures and Patrimonial collegia, the eleventh by the State Office and the Main Magistrate. The Holy Synod was located in the twelfth building. After the transformation of the collegia into ministries in 1802, they continued to remain in the same place.
In 1835, the Twelve Collegia building was transferred to Saint Petersburg University, for whose needs it was remodeled by architect Shchedrin: the second floor of the western gallery was glazed and turned into a corridor stretching the entire length of the building, connecting the buildings; a grand staircase and a white-columned assembly hall were constructed in the central part of the building.
Currently, the Twelve Collegia building still houses university faculties, as well as its central admissions office, the Museum of University History, and the Mendeleev Museum-Apartment. Students say that just before the winter exams, at exactly midnight, a ghost appears from the bookshelf in the library halls. The apparition slowly walks around the premises, searching for something, then vanishes into thin air. Some suggest it is a careless student who failed exams, did not answer the professor's tricky question, and now searches for the answer in the textbooks.
From the 18th century to the present day, the Senate (Petrine) Hall has been preserved with its painted ceiling and seven panels. In 2003, after archaeological research, one of the building's porches and a small section of paving in front of the main facade were restored to their original form. In 2007, a monument to university students was unveiled in front of the main entrance. The monument's composition features a figure of a flying angel with a torch in hand, towering over a fluted column set on a pedestal of dark red polished granite.
Sources:
https://www.petersway.org/monuments/russia/saint-petersburg/twelve_collegia/
http://www.hellopiter.ru/Building_of_twelve_boards.html
https://www.culture.ru/institutes/12004/zdanie-dvenadcati-kollegii
https://www.spb.kp.ru/daily/25965/2903643/