The near neutrino detector ND280 of the long-baseline accelerator experiment T2K has been upgraded to improve the precision of measurement of the neutrino oscillation parameters. A key component of the upgrade is a novel segmented plastic scintillator detector, Super Fine Grained Detector (SuperFGD), made of approximately 2 million optically isolated 1 cm3 cubes read out by three orthogonal wavelength-shifting fibres and multi-pixel photon counters. The SuperFGD provides 3D images of neutrino interactions by tracking the final-state charged particles including protons down to a threshold of about 300 MeV/c. Due to the fine segmentation and the sub-nanosecond time resolution, the SuperFGD is able to detect neutrons from neutrino interactions and to reconstruct their kinetic energy by measuring the time of flight. In this paper, the details of the detector design, construction and performance in the T2K neutrino beam are described.