Analysis of the drilling fluid temperature due to heat transfer of drilling fluid with the formation in under-balanced drilling operation is the main objective of this study. Gas-liquid two-phase flow model considering thermal interaction with the formation is used to numerically simulate a well with real dimensions. In the present study, the continuity, momentum, and energy equations are developed to compute the wellbore temperature profile. In this simulation, the effects of oil and gas production from the reservoir into the annulus and heat generated by viscous dissipation within the drilling fluid, heat generated by friction between the rotating drill string and the wellbore wall, and heat generated by the drill bit were included in the model. The results are validated with actual field data and also with two-phase flow model using the geothermal temperature gradient given in the literature. Comparisons of the present results show that two-phase flow numerical simulation with thermal consideration gives more accurate results compared to other models for the prediction of the bottom-hole pressure. Results show that the fluid temperature at the bottom-hole increases with increasing well depth, the flow rate of gas, and source terms consideration. Whereas the fluid temperature at the bottom-hole decreases with increasing liquid flow rate and specific heat of liquid and gas.