Herbicides are often selective and kill only weeds without affecting crops. In rice, CYP81A6 is responsible for tolerance toward acetolactate synthase herbicides such as bensulfuron‐methyl (BSM). CYP81A6 is thought to metabolize BSM into a nontoxic metabolite, that is, O‐demethylated BSM. However, direct evidences for this reaction have not been reported, likely due to difficulties in the heterologous expression of plant P450s in bacterial expression systems. In this study, we established CYP81A6 expression in Escherichia coli via modification of its N‐terminal basic region coding sequence, optimization of cultivation temperature, and selection of E. coli strains. Heterologous production of CYP81A6 was evaluated by the conversion of BSM in autoinduction medium after the culture, compared to that with an empty vector control. The optimized heterologous production condition of rice CYP81A6 in E. coli using 48‐well plates involved replacement of the N‐terminal basic region with that of CYP2C3, the use of E. coli BL21(DE3) as an expression host, and culture at 34°C. Further, co‐expression of gene encoding glucose dehydrogenase enhanced the conversion of 0.5 mM BSM from 58.7 to 73.1% in the optimized condition. In the optimization process, we detected two metabolites, M1 and M2. Mass spectrometry and 1H nuclear magnetic resonance analyses indicated that M1 was O‐demethylated BSM. Although we could not isolate M2 because of its low abundance in the medium, mass spectrometry analysis suggested that it was the monooxygenated (+O) form of BSM. Overall, these results confirm that CYP81A6 catalyzes the formation of O‐demethylated BSM from BSM.