The history of the Beji district, located in the city of Depok, is intertwined with both ancient legends and its colonial past. The name "Beji" is believed to come from an old Javanese word meaning a place with a water source, indicating the abundance of natural springs in the area. According to local lore, Beji's history begins in the 16th century with the arrival of a scholar from Cirebon named Mbah Raden Wujud Beji. During a time of severe drought, through his wisdom and prayers, he discovered seven miraculous wells that saved the local people and became a source of life for the entire area. These wells, known as "Sumur Tujuh" (Seven Wells), are still considered a sacred site and attract pilgrims today.
During the later colonial period, starting in the 17th century, the Beji territory was part of the lands acquired by Dutch East India Company official Cornelis Chastelein and developed as part of Depok's agricultural estates. The main factors that defined Beji's development were its geographical and strategic features. Its location on fertile land with numerous water sources made it attractive for agriculture from the earliest times. Proximity to the Ciliwung River, which served as a natural border and transport artery, facilitated its integration into the region's larger economic system.
Initially, Beji was primarily an agrarian district, and its cultural identity formed around the spiritual legacy of Mbah Beji and the sacred wells, which turned the area into an important spiritual center. The early economy was based on agriculture, which flourished within the colonial estates. Over time, due to its location and the growth of Depok, Beji began to transform from a rural outlier into a densely populated suburban district. Beji was officially established as an administrative district (kecamatan) in 1981.