Demanding transcriptomic studies in livestock animal species could be replaced by good in vitro models mimicking the function of mammary gland. Mammary epithelial cells (MEC) are the functional unit of the mammary gland. Extracellular matrix is known to be a key factor providing normal homeostasis in three-dimensional (3D) environment as important signals are lost when cells are cultured in two-dimensional (2D) environment. The aims of this study were to establish a buffalo mammary epithelial cells (BMECs) in 3D culture using extracellular matrix and to determine whether such a 3D culture model has different expression pattern than 2D counterpart. The purified MEC generated after several passages were used to establish 3D culture using Geltrex matrix. The expression of milk casein genes viz., alpha S1-casein (CSN1S1), alpha S2-casein (CSN1S2), beta-casein (CSN2), kappa-casein (CSN3); and fatty acid metabolism genes viz., butyrophilin (BTN1A1), glycerol-3-phosphate acyltransferase (GPAM), fatty acid-binding protein 3 (FABP3), and stearoyl-CoA desaturase (SCD) was assessed in 3D culture in comparison to traditional monolayer culture using qRT-PCR. Notable morphological differences were observed for BMECs grown in 3D culture in comparison to 2D culture. Morphologically, epithelial structures grown in Geltrex matrix (3D) environment showed enhanced functional differentiation in comparison to 2D culture. In 3D culture, lumen and dome-like structures were formed by day 5, whereas polarized acinus-like structure were formed within 15 days of culturing. The expression data showed higher mRNA induction of milk casein and fatty acid metabolism genes in 10-day-old 3D BMECs culture in comparison to 2D monolayer culture. The result suggests that 3D organization of epithelial cells has favorable effect on induction of milk and fatty acid metabolism-related genes. Therefore, matrix-based 3D culture of MEC that recapitulate the structural and functional context of normal tissues could provide a better in vitro model to understand the mammary gland functioning of buffaloes.