We present a search for the direct production of a light pseudoscalar a decaying into two photons with the Belle II detector at the SuperKEKB collider. We search for the process e+e-→γa, a→γγ in the mass range 0.2<ma<9.7 GeV/c2 using data corresponding to an integrated luminosity of (445±3) pb-1. Light pseudoscalars interacting predominantly with standard model gauge bosons (so-called axionlike particles or ALPs) are frequently postulated in extensions of the standard model. We find no evidence for ALPs and set 95% confidence level upper limits on the coupling strength gaγγ of ALPs to photons at the level of 10-3 GeV-1. The limits are the most restrictive to date for 0.2<ma<1 GeV/c2.