Direct numerical simulations of fully developed turbulent flows in a horizontal square duct heated from below are performed at bulk Reynolds numbers Re_b = 3000, 4400 in the range of bulk Richardson numbers 0 ≤ Ri ≤ 1.03 to characterize turbulence- and buoyancy-driven mean secondary flow. It is observed that for 0.025 ≲ Ri ≲ 0.25 turbulence-driven secondary flow of a usual eight-vortex pattern is deformed by the effect of buoyancy into turbulence- and buoyancy-driven flow represented by single large-scale circulation and four corner vortices of opposite sense of rotation to the circulation. This remarkable structural difference in the corner regions can be interpreted in terms of combined effects, on instantaneous streamwise vortices, of the large-scale circulation and of the geometrical constraint by impermeable duct walls.