The Badi Palace is the work of the Saadian king Ahmed El Mansour Ed Dahbi-(the Gold) (1578-1603). He was to commemorate his victory over the Portuguese army in the Battle of the Three Kings in 1578.
To build this great work, the sovereign chooses the northeast corner of the Casbah, near his private apartments. The construction work which gave rise to an enormous project lasted from 1578 to 1594. Some work continued until 1603, thus covering the entire reign of the sovereign. The Badiâ (the Incomparable) was intended for feasts and solemn audiences during which the sovereign could make watch his pomp as much to the elite of the kingdom before foreign embassies.
The palace complex consists of a large rectangular-shaped courtyard 135 m 110 m, the center of which was laid a pool of 90 m by 20 m in the center of which stood a monumental fountain with two superimposed basins and surmounted by a water jet. On either side of this central basin, two depressions are covered with trees and flowers arranged in squares separated by walkways paved with tiles. The angles of the palace are occupied by rectangular basins of 30 m by 10 m. Badiâ around the huge palace courtyard organize the imposing ruins of old houses (see map). From either side of the great central basin, rose two houses facing each: one, known as the Crystal Pavilion, was the subject of excavations which have uncovered his plan while structural work of the second, called Pavilion hearings, remains as high walls. Both, almost identical plan were covered by a dome with twelve columns. The floor of both houses was covered with zelliges which one can observe some specimen in the hearings Pavilion.

More about badi palace

Two other pavilions, larger dimensions, occupy the middle of the north and south sides. Unlike the first two, the layout of the Green Pavilion and Pavilion heliotrope, slightly recessed, allowed the development of two galleries open along the walls supported by two series of jasper columns.