The spatial-temporal evolution of the electron density (ne) and the electron temperature (Te) in a nanosecond microdischarge with a pin-to-pin electrode configuration is investigated by optical emission spectroscopy, using Stark broadening and collisional-radiative models. The measurement is focused on the evolution of the axial distribution (between the two electrodes) of both ne and Te. It is found that the time evolution of ne profile can be divided into three phases: (1) during the pulse-on period (breakdown to ∼16 ns), a very non-uniform profile develops under the influence of strong external electric field; (2) during the early afterglow period (∼16 ns to ∼ one hundred nanoseconds), the n e decreases and its profile gets more uniform due to diffusion; (1) during the late afterglow period (∼100 ns to ∼600 ns), the electron density profile becomes non-uniform again with its highest value near the power electrode. This is possibly caused by the secondary electron emission due to the ion impact onto the power electrode, which is biased negatively by the external power supply at this time. During the pulse-on period, the behaviour of the Te is similar to that of the ne, although its magnitude of the variation across the electrodes and with time is much smaller. In the afterglow period, the residue power input tends to slow down the electron cooling, especially in the region near the power electrode.