Upstream of history, the Vietnamese who came to the land of Thai Khang province, mainly settled in the plains formed by large rivers, namely Dinh River (Ninh Hoa), and the Cai River (Nha Trang, Dien Khanh). Simultaneously with the process of immigration, reclaimation and establishing villages, the Nguyen Lords also built quite stable and complete political institutions from the province, district to the hamlet, a long with teams of mandarins, government officers and servants managing and running the affairs of the feudal state. However, from the mid-18th century onwards, the Nguyen Lords and some mandarins were conservative in their socio-economic policies and led a lavish lifestyle. To meet their demand, they increased taxes and mandarins competed to plunder and exploit the people, bringing people hunger and destitution.
In 1771, the Tay Son uprising broke out led by three brothers, Nguyen Nhac, Nguyen Hue and Nguyen Lu, against the rule of Lord Nguyen. The harsh rule of the Nguyen Lords led the people of Dien Khanh to participate in supporting the Tay Son movement.
In 1775, after defeating the troops of Tong Phuc Hiep and Nguyen Khoa Thuyen at Tam Phong mountain (Co Ma pass, Van Tho commune, Van Ninh district), to strengthen the defense in the South and turn this into an important base during the attack on Gia Dinh, Tay Son army built in Khanh Hoa many fortresses and ramparts such as: Trai Thuy hill, Thuy Xuong area, Hoa Chau, Du Lam, Ninh Hai fortress, Hon Khoi fortress, Son Tap ...
In 1792, King Quang Trung passed away, the Tay Son dynasty was unstable, Nguyen Anh’s army took this opportunity to counterattack to restore the dynasty. In March 1793, Nguyen Anh brought infantry to attack Phan Ri. In July, Nguyen Anh’s army had captured the two districts of Dien Khanh and Binh Khang. After reviewing the Dien Khanh government office, Nguyen Anh saw that this was a strategic location, with convenient transportation by waterway (Cai river) and by road from North to South, close to Nha Trang estuary, so he had Dien Khanh citadel built as a solid military base for a long-term fight against the Tay Son army.
Nguyen Anh had Dien Khanh Citadel built in the territory of two communes Phu My and Truong Thanh, Phuoc Dien commune, Dien Khanh district, Binh Khang province and assigned it to Nguyen Van Thanh to guard. After that, he moved the old headquarters of the province from Phuoc Da commune, Quang Phuoc district, Binh Khang province to Dien Khanh citadel and this became the political and military center of Binh Khang province.
According to the book Dai Nam Nhat Thong Chi of the National History of the Nguyen Dynasty, about the citadel of Khanh Hoa province:
The perimeter is 636 trượng, 7 thước 4 tấc (trượng = 4m, thước = 40cm, tấc = 4cm), 7 thước 5 tấc high, with 4 gates; the moat is 4 tượng wide, 6 thước deep. It was built of soil in the territory of two communes Phu My and Phuc Thinh, Phuc Dien district. Formerly the headquarters of the province was in the territory of Da Phuc commune, Quang Phuc district, then moved to the present place, i.e. the old Dien Khanh citadel – Consider: Dien Khanh citadel was formerly the headquarters of Nha Trang, in the year of Quy Suu (1793) the army of The king attacked Quy Nhon, when he returned, he stopped at Dien Khanh. He looked at the land, then told Hoa Bong to cover the citadel with earth. The citadel had six gates, all of which had upstairs; four corners of the citadel had mountains of soil; outside the citadel were moats, outside the moats were camps. The gates all have suspension bridges crossing the moat. The front and back were surrounded by mountains and rivers, which was a dangerous place. Up to now two gates have been removed. The fortress and mountains are still there, the north of the citadel is leaning against the Cai River, often being eroded by flood water, so in the 4th year of Minh Menh, a dike was built to block the river, and then piers were dug to direct the water to the north. 
Historical documents also record that Dien Khanh Citadel was directly supervised by Prince Canh, and the manpower to build the citadel included 3,000 Binh Thuan troops, 100 Thuan Thanh people, and in more than a month it was completed.
* Old Dien Khanh Citadel:
At the time of construction, the citadel was built on an empty land, shaped like a turtle’s back. Outside was a deep moat system, inside there were two stairs used as a way up and down. The corners of the wall were protruding outwards for easy viewing on both sides. Inside each corner was a large area of land used as a shelter. Each corner of the citadel was built with an earthen mound about 2m high to place cannons, called the corner fortress. This is a prominent feature of Vauban-style military architecture. There were many bamboo and thorn trees on the wall to increase the durability of the wall and form a defensive barrier. The moat system outside the citadel is from 3m to 5m deep, unevenly wide and narrow depending on the terrain. In the moat there was often water and many obstacles. Outside the moat, there was an outer moat. To enter the city, they had to go through the bridge over the moat.
The citadel walls meandered in a hexagonal shape, about 2,600m long and 3.5m high. The outer side of the citadel was slightly vertical, the inner side was gently sloped, and the two sides of the gate had steps to use as the way up and down. Each gate had a gazebo so that the guards could see into the distance. In the corner, high mounds were built to place defensive cannons, outside the wall there was a protective moat, outside the moat was a barracks; in front of each gate there was an iron arch bridge to get in.
* Current Dien Khanh Citadel:
The four citadel gates are built in the same way. The gates do not have elaborate decorative patterns, but only names of each gate in Chinese characters: Dong, Xi, Front, and Back. The gates were built of fired bricks, plastered with lime mortar. The arch in the middle forms a path below.
The two sides of the gates were 3m-wide steps to go up to the top of the Citadel. Above the Citadel gate was a quadrangle with four gates in four directions. The top floor is an ancient floor with a curved roof with yin and yang tiles. The two sides of the quadrangle were built with railing.
Connected to the four gates is a system of sloped walls made of earth on the inside, slightly vertical on the outside. The segments of the earth wall are no longer connected seamlessly as before; The total length of the current earthen wall is 2,500m long, 3m high, and 5m wide.
Although the Dien Khanh Citadel was built in the Vauban style clearly shown in the wall with a system of fortresses outside the moat, the gates and the mansions built in the Citadel still follow Oriental traditional architectural features. According to some documents, in the past, there were some architectural works such as: King’s resting room, palace of local mandarin, Surveillance place, military commander’s place, food storage, prison... , which were made according to the regulations of the Nguyen dynasty and built according to the architectural style of Vietnamese houses.
In the area of the 974th Regiment, there is still a cannon on the cannon platform on the open ground in front of the Regiment gate. In addition, there is a temple with only four walls and above is the Chinese letters “Thanh Phi Mieu”, Bao Dai 6th year (1931).
Currently, in the citadel are the headquarters of administrative agencies, schools and people’s houses.
Over time, the citadel was mossy and many sections of the earth wall and moat were eroded. For the past years, Dien Khanh Citadel has been restored many times and zoned protected areas in order to embellish and promote the relic’s value.
In 1988, Dien Khanh Ancient Citadel was ranked as the National historical - cultural relic.
 National Histroy of Nguyen Dynasty. Dai Nam Nhat Thong Chi (2006), vol. 3, book XI, page 107.