Ceramics typically have very high hardness, but low toughness and plasticity. Besides intrinsic brittleness associated with rigid covalent or ionic bonds, porosity and interface phases are the foremost characteristics that lead to their failure at low stress levels in a brittle manner. Here we show that, in contrast to the conventional wisdom that these features are adverse factors in mechanical properties of ceramics, the compression strength, plasticity and toughness of nanocrystalline boron carbide can be noticeably improved by introducing nanoporosity and weak amorphous carbon at grain boundaries. Transmission electron microscopy reveals that the unusual nanosize effect arises from the deformation-induced elimination of nanoporosity mediated by grain boundary sliding with the assistance of the soft grain boundary phases. This study has important implications in developing high-performance ceramics with ultrahigh strength and enhanced plasticity and toughness.