Scaffolds of molecules play a critical role in determining their molecular properties. Thus, generating molecules retaining aspecific scaffold as a substructure has practical advantages in molecular design, for instance, in drug discovery. Accordingly, we developed a scaffold-based molecular graph generative model. The model generates new molecular graphs by extending the graph of a scaffold through successive additions of atoms and bonds. In contrast to previous related models, our model guarantees that the generated molecules have the scaffold as a substructure.The model showed high validity, uniqueness, and novelty of generated molecules, showing that the model can learn chemical rules of adding atoms and bonds rather than simply memorizing the training set. We also tested that our model can generate molecules with desirable properties. Despite the fact that the scaffold restricts the search space,our model successfully generated new molecules with a desirable molecular property while retaining a scaffold. Moreover, the model can simultaneously control multiple molecular properties of generated molecules. We further tested that scaffold-based generation strategy is applicable for designing epidermal growth factor receptor inhibitor (EGFR) where only a small amount of labeled data is available. We trained the model with both a small amount of labeled data and a large amount of unlabeled data in a semi-supervised manner. As a result, the model designed new potential EGFR inhibitors whose predicted binding affinity is about 1.5 higher than those of their scaffolds in terms of pIC50.