We investigate the dynamics of a fluid layer subject to an imposed bottom heat flux and a top monotonically-increasing temperature profile driving horizontal convection. We use direct numerical simulations and consider a large range of flux-based Rayleigh numbers 106≤RaF≤109 and imposed top horizontal to bottom vertical heat flux ratios 0≤Λ≤1. The fluid domain is a closed two-dimensional box with aspect ratio 4≤Γ≤16 and we consider no-slip boundaries and adiabatic side walls. We demonstrate a regime transition from Rayleigh--Bénard convection (RB) to horizontal convection (HC) at Λ≈10−2, which is independent of RaF and Γ. At small Λ, the flow is organized in multiple overturning cells with approximately unit aspect ratio, while at large Λ a single cell is obtained. The RB-relevant Nusselt number scaling with RaF and the HC-relevant Nusselt number scaling with the horizontal Rayleigh number RaL=RaFΛΓ4 are in good agreement with previous results from classical RB convection and HC studies in the limit Λ≪10−2 and Λ≫10−2, respectively. We demonstrate that the system is multi-stable near the transition Λ≈10−2, i.e. the exact number of cells not only depends on Λ but also on the system's history. Our results suggest that subglacial lakes, which motivated this study, are likely to be dominated by RB convection, unless the slope of the ice-water interface, which controls the horizontal temperature gradient via the pressure-dependence of the freezing point, is greater than unity.