The mass of the top quark is measured using a sample of t t ¯ events collected by the CMS detector using proton-proton collisions at s=13TeV at the CERN LHC. Events are selected with one isolated muon or electron and at least four jets from data corresponding to an integrated luminosity of 35.9fb-1. For each event the mass is reconstructed from a kinematic fit of the decay products to a t t ¯ hypothesis. Using the ideogram method, the top quark mass is determined simultaneously with an overall jet energy scale factor (JSF), constrained by the mass of the W boson in q q ¯ ′ decays. The measurement is calibrated on samples simulated at next-to-leading order matched to a leading-order parton shower. The top quark mass is found to be 172.25±0.08(stat+JSF)±0.62(syst)GeV. The dependence of this result on the kinematic properties of the event is studied and compared to predictions of different models of t t ¯ production, and no indications of a bias in the measurements are observed.