This paper is concerned with the high Reynolds number flow over a spanwise-periodic array of roughness elements with interelement spacing of the order of the local boundary-layer thickness. While earlier work by Goldstein et al. (J. Fluid Mech., vol. 644, 2010, pp. 123–163) and Goldstein et al. (J. Fluid Mech., vol. 668, 2011, pp. 236–266) was mainly concerned with smaller roughness heights that produced relatively weak distortions of the downstream flow, the focus here is on extending the analysis to larger roughness heights and streamwise elongated planform shapes that together produce a qualitatively different, nonlinear behaviour of the downstream wakes. The roughness scale flow now has a novel triple-deck structure that is somewhat different from related studies that have previously appeared in the literature. The resulting flow is formally nonlinear in the intermediate wake region, where the streamwise distance is large compared to the roughness dimensions but small compared to the downstream distance from the leading edge, as well as in the far wake region where the streamwise length scale is of the order of the downstream distance from the leading edge. In contrast, the flow perturbations in both of these wake regions were strictly linear in the earlier work by Goldstein et al. (2010, 2011). This is an important difference because the nonlinear wake flow in the present case provides an appropriate basic state for studying the secondary instability and eventual breakdown into turbulence.