The potential of ultrawide-bandgap (UWBG) semiconductors has not been fully explored because of the difficulty of forming a p-n homojunction. In this study, a mixed-dimensional UWBG p-n heterojunction composed of a p-type diamond substrate and an n-type exfoliated β-Ga2O3 nanolayer has been demonstrated via a van der Waals interaction; this type of structure does not suffer from lattice mismatch. Rectifying current-voltage characteristics with a rectification ratio exceeding 107 were obtained with a high reverse hard breakdown voltage of 135 V. This UWBG p-n heterojunction diode exhibited good thermal stability at elevated temperatures, retaining its high rectification ratio and low reverse leakage current. Excellent photoresponse characteristics, including responsivity (12 A W−1), rejection ratio (8.5 × 103), photo-to-dark-current ratio (3900), and fast response/decay characteristics, were observed from the diamond/β-Ga2O3 p-n heterojunction photodiode, showing no persistent photoconductivity. The mixed-dimensional p-n heterojunction diode based on two UWBG semiconductors (p-type diamond and n-type β-Ga2O3) can be used as a robust building block in next-generation power electronics and solar-blind optoelectronics.