Glyphosate, the active ingredient of glyphosate-based herbicide (GBH) controls the growth of weeds by inhibiting shikimate pathway, thereby interrupting amino acid biosynthesis in plants. However, several microbes have shikimate pathway and the action of glyphosate on these non-target organisms are ignored. Along with other agrochemicals such as phosphate fertilizers, the action of GBH is further complicated, often varying their mode of action depending on soil type or plant species. To address the impact of GBH and phosphate fertilizer, we simulated agricultural application of GBH and phosphate fertilizer in a field study, investigating the composition of endophytic microbial communities and correlation of phytohormone concentrations with the microbial diversity of potato (Solanum tuberosum). In leaves, glyphosate residues in soil from GBH treatment alone and in combination with phosphate significantly shifted bacterial community whereas phosphate alone and in combination with glyphosate significantly altered the composition of fungal community. There were no significant changes in microbial communities in roots and tubers. Plants treated with GBH showed higher ratios of potentially glyphosate-resistant bacteria, with Xanthomonadaceae and Moraxallaceae being more abundant. Additionally, phytohormone concentrations showed various correlations with bacterial and fungal diversity in different treatments. The study highlights the impact of GBH residues in soil, particularly in combination with phosphate fertilizers on the composition of plant-associated microbial communities. Together with changes in phytohormone concentrations, plant health may be affected. Moreover, future studies could provide insights to whether these agrochemicals influence plant microbiome, leading to changes in phytohormones or vice-versa.