We have optimized the responsivity and response speed of a β-Ga2O3-based photodetector. The β-Ga2O3 thin films were deposited on a glass substrate under various oxygen partial pressures from 0 to 50 mTorr using pulsed laser deposition. Time-response measurements show that the as-grown β-Ga2O3 at an oxygen partial pressure of 50 mTorr has the fastest response speed and decay times of 33 and 100 ms, which are better than those prepared at lower oxygen pressures. This sample also showed a high photoresponsivity of 5 A W−1 and detectivity of 1012 cmHz1/2/W. The high performance of the β-Ga2O3 detector grown at the oxygen partial pressure of 50 mTorr might be due to the reduction of oxygen vacancies caused by the increase in oxygen content during deposition. The results reveal the importance of the oxygen processing gas in promoting photodetector performance.