In this study, AISI 5140 steel samples were borided in an electrical furnace at a temperature of 950 degrees C for 4, 6 and 8 h. Structural examinations, hardness measurement and corrosion tests were performed to determine the effect of the boriding time on the microstructure, hardness and corrosion resistance of the steel surface. It was observed that 4 h of boriding treatment resulted in the forming of Fe2B layer on the surface of the AISI 5140 steel. However, when the boriding time exceeded 4 h, FeB phase formed on the surface layer of the steel in addition to the Fe2B phase. It was also observed that both the thickness and hardness of the boride layer increased with the increasing boriding time. The hardness values of the borided sample surface were approximately seven times greater than unborided AISI 5140 steel. The samples subjected to boriding for 4 h showed higher corrosion resistance than the unboriding steel samples. But boriding time of more than 4 h caused a decrease in the corrosion resistance of the AISI 5140 steel.