Myofibroblasts (MFs) are present in healthy tissues and are also key components of the tumor microenvironment. In the present study a comparative analysis of MFs obtained from various gastrointestinal tumor tissues and from tumor‑adjacent normal tissues of cancer patients was performed, with the aim to evaluate differences in MF morphology, gene expression profile and function. The goal was to correlate the observed morphological and functional variations with the underlying genetic and epigenetic backgrounds. The mutation frequency of MFs was assessed by next generation sequencing. The transcript levels of cancer‑specific genes were determined by TaqMan array and quantitative polymerase chain reaction. Epigenetic modifications were analyzed by immunocytochemistry and western blotting. The migratory capacity of MFs was assessed by scratch assay, whereas matrix metalloproteinase expression and activity were obtained by quantitative polymerase chain reaction and zymography. The results of the present study demonstrate that MFs were present in an increased number and with altered morphology in tumor samples compared with the healthy tissue. Although the detected number of mutations in tumor‑associated and normal tissue‑derived MFs did not differ markedly, shifts in the level of specific acetylated and methylated histone proteins, namely decreased levels of trimethylated H3K9 and acetylated H4K16 were demonstrated in tumor‑associated MFs. Transcript levels of several tumor‑specific genes involved in metastasis, regulation of cellular growth, apoptosis, as well as in hypoxia‑angiogenesis were altered in tumor‑derived MF cultures. Increased mRNA levels were obtained and activity of matrix metalloproteases in tumor‑derived MFs and these cells also exhibited a higher migratory capacity compared with the normal MFs. In summary, the results of the present study indicate that tumor‑associated MFs display an altered phenotype compared with healthy tissue derived counterparts. The results imply that epigenetic rather than genetic alterations are associated with the development of the distinct expressional and functional features, which define this MF phenotype in the tumor microenvironment.