Mesoporous TiO2 structure (mp-TiO2) with a compact TiO2 blocking layer (bl-TiO2) has been recognized as an effective photoanode for high-performance dye-sensitized solar cells (DSSCs). However, producing both mesoporous and compact TiO2 layers by conventional method requires a high-temperature furnace process via a two-step manufacturing route. Here, a one-step laser technique has been successfully developed to generate both mesoporous and compact TiO2 layers on tin-doped indium oxide (ITO) coated glass by a millisecond pulsed fiber laser with a wavelength of 1070 nm in ambient atmosphere. Compared with the conventional furnace process, the laser process exhibits a significant reduction of overall fabrication time from 5 h 20 min to 2 min. More importantly, the DSSCs fabricated by the laser process show a remarkable improvement with the maximum power conversion efficiency (PCE) by 34% compared with the DSSCs fabricated by the furnace. The short-circuit current density (Jsc) reaches 16.5 mA cm-2 for the DSSCs fabricated by the laser process while 10.6 mA cm-2 is obtained for those fabricated by the furnace process. The improvement is associated with the increased dye adsorption, decreased charge transfer resistance, and increased electron lifetime of the TiO2 photoanode fabricated by the laser process.