The occurrence of Potentially Toxic Elements (PTEs) and other chemical elements in urban and peri-urban soils impacts human health and quality of life, posing a challenge for geoscientists. This study investigated the soil geochemistry of Lamia City, focusing on identifying the geogenic and anthropogenic origins of elements. A total of 168 topsoil samples (0-10cm) were collected in April 2023, and the analysis included the near-total concentrations of 51 elements. Descriptive, correlation, multivariate statistics (i.e., Factor Analysis-FA and Hierarchical Cluster Analysis-HCA), Geographic Information Systems (GIS) mapping, and mineralogical analysis were employed to identify potential element sources. The results indicated that the elements in soils originated from geogenic, anthropogenic, and mixed sources. Geogenic origins are associated with ultramafic rocks (e.g., Mg, Cr, Ni, Co, Fe, Sc, Mn), carbonate rocks (e.g., Ca, Sr), and Quaternary sediments (e.g., K, Na, Ba, Tl, Be, Rb, Ti, V, Ga, and Rare Earth Elements-REEs); associations are linked to specific identified minerals. All applied statistical analyses reveal that the mobility of chemical elements in the urban and peri-urban soils of Lamia city is primarily affected by geochemical processes such as element substitution, chemical weathering, pedogenesis, adsorption, precipitation, evaporation, and organic matter presence. The P, Ag, Hg, Pb, Sn, Zn, Sb, Cd, Cu, and U were associated with anthropogenic influences, particularly in areas with high population density, heavy vehicle traffic, and intensive agricultural practices. Additionally, some elements (e.g., Ca, Cd, Cu, Mo, Mn, and Li) exhibited mixed origins. This integrated approach offers valuable insights into the spatial distribution and sources of PTEs in urban and peri-urban environments, providing critical information for environmental management and public health protection strategies.